# Writing a small Programming Language

**URL:** <https://discourse.processing.org/t/writing-a-small-programming-language/24095>\
**Category:** Project Guidance\
**Created:** [September 24, 2020, 9:30am UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095 "2020-09-24T09:30:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![yairkass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/yairkass/32/5366_2.png) [@yairkass](https://discourse.processing.org/u/yairkass)\
**Post date:** [September 24, 2020, 9:30am UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/1 "2020-09-24T09:30:27Z")

</div>

hey guys,  
For a couple of years now iv’e been wanting to write a small programming language  
in HEBREW for my young (now 7) and curious daughter.

Iv’e researched some and I feel like I know what has to be learned,  
but I also saw thing like SLY for Python that help you generate Lexers,ASTs etc… without  
building them from scratch.

I wanna do it in Processing, any ideas? is there any library that could help me?

this is quite daunting for me but I really wanna give it try

:-))

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 24, 2020, 9:56am UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/2 "2020-09-24T09:56:59Z")

</div>

you could look here for a start: [http://www.lagers.org.uk/qscript/](http://www.lagers.org.uk/qscript/) - QScript [EDITED]

---

<div class="post-metadata">

**Author:** ![Hyperion65](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hyperion65/32/10569_2.png) [@Hyperion65](https://discourse.processing.org/u/Hyperion65)\
**Post date:** [September 24, 2020, 10:26am UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/3 "2020-09-24T10:26:08Z")

</div>

what about swift ([https://www.apple.com/education/k12/teaching-code/](https://www.apple.com/education/k12/teaching-code/)), tynker ([https://www.apple.com/education/k12/teaching-code/](https://www.apple.com/education/k12/teaching-code/)) or scratch ([https://scratch.mit.edu/projects/editor/?tutorial=getStarted](https://scratch.mit.edu/projects/editor/?tutorial=getStarted)) ?  
or blockly a library that you can incorporate into javascript ([https://developers.google.com/blockly](https://developers.google.com/blockly)) mb allowing you to dress your language wishes  
probably you know all these already 😉

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [September 24, 2020, 11:08am UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/4 "2020-09-24T11:08:51Z")

</div>

I don’t believe that there is anything on my website (Quarks Place) that would help. Sorry.

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 24, 2020, 11:10am UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/5 "2020-09-24T11:10:48Z")

</div>

Ah, sorry, I was specifically linking to QScript - @quark

When he wrote a editor he could “transpile” his Hebrew into QScript and run it there.

Chrisir

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [September 24, 2020, 3:05pm UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/6 "2020-09-24T15:05:01Z")

</div>

> [@Chrisir](#):
>
> Ah, sorry, I was specifically linking to QScript

NP I didn’t click on the link so assumed it went to the home page 😇

I assume that he wants the programming language to be in Hebrew rather than the standard US English. Not an area I am familiar with but here is a couple of suggestions

- to fork the Processing project on github and change the classes to use Hebrew
- Use Java regular expressions or Perl to convert the Hebrew source code to Java standard syntax thus replacing the Processing transpiler.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [September 24, 2020, 7:50pm UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/7 "2020-09-24T19:50:31Z")

</div>

> [@yairkass](#):
>
> write a small programming language  
> in HEBREW for my young (now 7) and curious daughter

This sounds like a great project. I’m a co-organizer of the Critical Code Studies working group, and our online conference this year had a week on [indigenous programming](http://wg20.criticalcodestudies.com/index.php?p=/discussion/70/week-2-indigenous-programming-main-thread) and ethnoprogramming, which is somewhat related in that it is often concerned with the ethics and logistics of developing [Non-English programming languages](https://en.wikipedia.org/wiki/Non-English-based_programming_languages). For example, here is part of a thread on a Cree programming language which discusses [incorporating non-Arabic numerals](http://wg20.criticalcodestudies.com/index.php?p=/discussion/comment/851/#Comment_851) in programming language design.

If you haven’t already, I would suggest brainstorming ideas by looking at existing Hebrew programming, especially Hebrew programming for children – for example:

- [TamliLogo](http://www.orianit.edu-negev.gov.il/bagrutcm/cp/homepage/tamlilogo.htm) ( **תמלילוגו** )
- I believe that [Scratch](https://scratch.mit.edu/) and [ScratchJr](https://www.scratchjr.org/) have Hebrew language support and have been used for Hebrew programming – although they are block languages, so don’t use a Hebrew syntax or lexer.
  - [Computer Programming: An Unexplored Path to Jewish Literacy](https://ejewishphilanthropy.com/computer-programming-an-unexplored-path-to-jewish-literacy/)
  - [“Coding Comes to Hebrew!”](https://www.rashi.org/news-detail?pk=848361)

- ([HPL – Hebrew Programming Language](http://hpl.sourceforge.net/)) – an old project from ~2003 that was a c++ parser with a Java IDE. I’ve never looked at it – I’m honestly not sure if it was actually developed, or is just a project template, but the source code is available.
- [Lang871](https://github.com/Aviv871/Lang871)

If you want to adapt or incorporate a Hewbrew lexer into Processing, or want a model for someone who has already done it in Java, my guess is that [Lang871](https://github.com/Aviv871/Lang871) will be your best bet. The programs look like this:

```auto
עבור א=4,א>0,א=א-2:
	הדפסש "אחלה"
סוף

עבור א = 4, א > 0, א = א - 1:
	הדפסש "יפה"
סוף

```

and are stored in files with a `.871` extension. Lang871 is more recent (last changes and kindly made a new release this week), and it is Java. The repo says “Windows support only” but I was able to launch the IDE Jar on my mac as well, and my guess is that you could import some of the Java resources directly into a Processing project – and/or build your own forked jar to include as a library, rather than using its IDE wrapper.

Good unicode and font support is going to be crucial. You may want to consider using Processing 4 as your platform if you run into any problems, although in terms of the code points you should be fine – I believe that the only [Hebrew code point](https://en.wikipedia.org/wiki/Hebrew_(Unicode_block)) missing from Java 8 / Processing 3 is U+05EF.

Also: While it isn’t a programming language, you might also be interested in browsing [processing.co.il](https://web.archive.org/web/20070722170454/http://www.processing.co.il/), which was a Hebrew-language resource for Processing, ~2003-2007.

Good luck, and let us know what direction you choose and how it is going!

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 24, 2020, 8:11pm UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/8 "2020-09-24T20:11:17Z")

</div>

**Turtle Script**

here is one script language with a Turtle (like in Logo)

Here: [https://github.com/Kango/3D-Turtle/tree/master/scriptTurtle](https://github.com/Kango/3D-Turtle/tree/master/scriptTurtle)

It’s actually a 3D Turtle but you could reduce it to 2D - and to Hebrew, I hope

 ![Unbenannt](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/b76de58f468bdd38254e28a1abf779ba1bad3d09.png)

* * *

**Wasd-Turtle in 2D**

here is also a 2D Turtle with a wasd steering which is not a real programming language but the commands (like w,a,s,d and others) get recorded and you can load and save and run them.

Here: [https://github.com/Kango/Turtle-2D-](https://github.com/Kango/Turtle-2D-)

 ![Unbenanwwnt](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/a/acbb3aa2c46db887c4d02f99a2a60b3823025b2f.png)

Both are done with incredible help by the forum!

Chrisir

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 25, 2020, 10:55am UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/9 "2020-09-25T10:55:22Z")

</div>

here is another Sketch where you can drag command items for the Turtle

There is a lot of work to do.

When you are interested, pm me please.

 ![graphical](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e71d40dc44e52cb0187c37d61d86dfff15afc5aa.png)

Chrisir

---

<div class="post-metadata">

**Author:** ![yairkass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/yairkass/32/5366_2.png) [@yairkass](https://discourse.processing.org/u/yairkass)\
**Post date:** [September 25, 2020, 7:51pm UTC](https://discourse.processing.org/t/writing-a-small-programming-language/24095/10 "2020-09-25T19:51:54Z")

</div>

wow what a great and informative answer.  
thanks sooo much.  
i will check all this out when my kids allow me 🙂  
here in Israel we just got into at least two weeks of lockdown due to COVID 19
