Re:I told my 2nd year CS students to create a programming la...
by dovyski on Tuesday May 15, 2012 @07:41AM
(#3976074)
It makes sense to me. Even though this is the "right" way of creating an "interpreted" language, the assignment I asked my students was way more simple: they had to interpret the source code and react to it immediately. There was no intermediate instructions (such as Java byte-code).
Re:I told my 2nd year CS students to create a programming la...
by laserDinosaur on Tuesday May 15, 2012 @09:39AM
(#3976478)
Awesome, thanks for the explanation :)
You write a program in C that is able to transform LASERD source files in to a form that it can interpret and then execute.
One way to do this is to create a simple virtual machine as part of your C program that is sort of like a virtual CPU (with registers, pretend memory and simple opcodes like ADD, SUBtract, MOVe etc.
The C program takes the LASERD source file interprets the syntax and generates code that can 'run' on the virtual CPU.
This is basically how Lua, Python, Ruby, Java etc work.
Does that make sense?