sum = 0
array = [1, 2, 3, 4, 5]
for x in array:
sum += array[x]
or in javascript (ECMAScript 2015):
var sum = [1, 2, 3, 4, 5].reduce((a, b) => a + b, 0);
And that is the main points of the paper "Building Server-Side Web Language Processors", which tries to build a language processor which is coded and maintained using web technologies. This approach can be more suitable for a person who knows more about constructing web solutions than someone that works with a terminal. As making a compiler is not a task a computer science graduate does often in most of the companies, it can be more valuable to create it while using tools that are common such as HTML, CSS, Javascript and other, so that the student can get experience in two areas.
There are many server side programming languages options to choose, it can be PHP, Node (Javascript), Python, Ruby, and if you are using a framework like ruby on rails, django or another you can stop worrying about cross-site scripting and work more in the implementation and design, the only disadvantage is the learning curve if you don't know them. And if you decide to use web technologies to teach how to do language processors, you will have the drawback of having to give web lectures and such thing can take a little bit of time.
If you are interested on checking some already made content you can go to:
You will find examples for the implementation of some of the strategies used on the pdf Building Server-Side Web Language Processors, written by Ariel Ortiz.
Sources:
Ortiz, A. 2010. "Building Server-Side Web Language Processors". Retrieved 12 March 2017 from: http://webcem01.cem.itesm.mx:8005/publicaciones/weblang.pdf
No hay comentarios:
Publicar un comentario