Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: I wrote a Logo interpreter using JavaScript
1 point by alabhyajindal 22 days ago | hide | past | favorite | 2 comments
Hi everyone -

I wrote a Logo interpreter in JavaScript, no regex, no external libraries. https://logo-lang.pages.dev

I wanted to understand how interpreters work but I struggled with the regex that's used to implement parsers for most interpreters.

Logo's syntax is simple and it allowed me to implement it without regex. There are no external libraries - SVG is used for drawings.

I wrote a short book about the project: https://alabhya.gumroad.com/l/logo

Source: https://github.com/alabhyajindal/logo




Is your Logo interpreter implemented as a functional language?

I was introduced to Logo in 1st grade. (Moving the turtle around to draw stuff...)

- Years later: when learning how to program, my mind was blown when I found out I was actually already programming in 1st grade.

- Years after that: while learning functional programming, my mind was blown again when I discovered Logo is actually a functional language[1].

[1]: https://www.wikiwand.com/en/Logo_(programming_language)


I had a very similar experience! Learning Logo in 1st grade and rediscovering it later.

Logo is a functional language but I have impemented it in an imperative fashion. I look at the entered commands and process them one by one.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: