Language used in writting VM

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Language used in writting VM

vishparshav1
Hey can somebody help me by telling which language is used in writting the VM
Plz reply asap on vishparshav1@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Language used in writting VM

ybakos
Any programming language you wish. It is fun!
Reply | Threaded
Open this post in threaded view
|

Re: Language used in writting VM

vishparshav1
ok so which language do u used to write your own vm

On 10/23/13, ybakos [via Nand2Tetris Questions and Answers Forum]
<[hidden email]> wrote:

>
>
> Any programming language you wish. It is fun!
>
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://nand2tetris-questions-and-answers-forum.32033.n3.nabble.com/Language-used-in-writting-VM-tp4027413p4027415.html
>
> To unsubscribe from Language used in writting VM, visit
>
Regards,

Vishesh Parshav
Reply | Threaded
Open this post in threaded view
|

Re: Language used in writting VM

cadet1620
Administrator
vishparshav1 wrote
ok so which language do u used to write your own vm
I wrote my Nand2Tetris tools using Python.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Language used in writting VM

ybakos
In reply to this post by vishparshav1
Mine is in Ruby.
Reply | Threaded
Open this post in threaded view
|

Re: Language used in writting VM

vishparshav1
can it be written in c also

On 10/24/13, ybakos [via Nand2Tetris Questions and Answers Forum]
<[hidden email]> wrote:

>
>
> Mine is in Ruby.
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://nand2tetris-questions-and-answers-forum.32033.n3.nabble.com/Language-used-in-writting-VM-tp4027413p4027419.html
>
> To unsubscribe from Language used in writting VM, visit
>
Regards,

Vishesh Parshav
Reply | Threaded
Open this post in threaded view
|

Re: Language used in writting VM

cadet1620
Administrator
vishparshav1 wrote
can it be written in c also
Yes, you could write the VM translator (and the Jack compiler) in C, but it would be difficult since C does not have built in collection data types. You would need to write your own data structures to support symbol look up, or search for suitable libraries on the internet. String parsing is also tricky in C; you'll be doing lots of strchar(), strpbrk(), etc. calls and lots of pointer work.

An object oriented language is also quite helpful so that you can have your symbol table, etc., contain symbol objects that themselves contain the required symbols' information.

C++ would be a better choice since it is OO and has the Standard Template Library, but is is a big learning curve over C.

Languages like Python and Ruby have very powerful collection data types that are easy to use, and much better string handling. Because they are interpreted languages rather than compiled, they also make it easier to debug your programs.


Did you write your Hack Assembler in C?

--Mark