Discuss Scratch
- Greg8128
-
500+ posts
Writing your own programming language
Writing a programming language is a fun and very interesting project! You can learn about how computers understand programming languages, and try adding different features to your programming language to figure out what you like.
Here is a tutorial that I like: http://buildyourownlisp.com/ It will teach you how to write a simple Lisp-like programming language from scratch. From there, you can experiment with adding your own features to the language, such as user-defined types. It does use C, but it explains what it uses.
Feel free to share other tutorials, including your own!
Here is a tutorial that I like: http://buildyourownlisp.com/ It will teach you how to write a simple Lisp-like programming language from scratch. From there, you can experiment with adding your own features to the language, such as user-defined types. It does use C, but it explains what it uses.
Feel free to share other tutorials, including your own!
- Vaibhs11
-
1000+ posts
Writing your own programming language
Making languages using C is very efficient. Some other languages like python or JavaScript is also easy. In C, strings are entirely considered arrays. But in python, there is the method.
The easiest language you can create/recreate using C is something with one character functions, like bf. Normal languages can take alot more space, there, use other easy languages instead like python. There are some tips I recommend using C to create a programming language:
1) Convert the character to ASCII before comparing it to avoid warnings. Helped me alot.
2) Use string.h, it's obvious and will help you add many features.
3) Add variable types. If it's too complicated, go to JavaScript
string[0]
The easiest language you can create/recreate using C is something with one character functions, like bf. Normal languages can take alot more space, there, use other easy languages instead like python. There are some tips I recommend using C to create a programming language:
1) Convert the character to ASCII before comparing it to avoid warnings. Helped me alot.
2) Use string.h, it's obvious and will help you add many features.
3) Add variable types. If it's too complicated, go to JavaScript
- gosoccerboy5
-
1000+ posts
Writing your own programming language
http://buildyourownlisp.com/!Looks cool! I will do that when I have the time!
(why are all the cool websites http

- mybearworld
-
1000+ posts
Writing your own programming language
I did try to make one once - but within Python, so I guess it isn't a “real” programming language
- Greg8128
-
500+ posts
Writing your own programming language
Good advice! That being said, something like bf is easy to make, but hard to use. A different experience, but an interesting one still Making languages using C is very efficient. Some other languages like python or JavaScript is also easy. In C, strings are entirely considered arrays. But in python, there is themethod.string[0]
The easiest language you can create/recreate using C is something with one character functions, like bf. Normal languages can take alot more space, there, use other easy languages instead like python. There are some tips I recommend using C to create a programming language:
1) Convert the character to ASCII before comparing it to avoid warnings. Helped me alot.
2) Use string.h, it's obvious and will help you add many features.
3) Add variable types. If it's too complicated, go to JavaScript
Nothing wrong with making it in Python. You can always port the runtime to C or Rust if you need better performance. I did try to make one once - but within Python, so I guess it isn't a “real” programming language
- ScratchCatHELLO
-
1000+ posts
Writing your own programming language
any tips on making a language in python? (eg useful modules and how to use them)
- linearlemur
-
500+ posts
Writing your own programming language
any tips on making a language in python? (eg useful modules and how to use them)
Sly is a good library for writing lexers and parsers: https://sly.readthedocs.io/en/latest/sly.html
- gosoccerboy5
-
1000+ posts
Writing your own programming language
I think ScratchCatHELLO has looked into that before.. (why do I remember that) (thanks ocular search)Sly is a good library for writing lexers and parsers: any tips on making a language in python? (eg useful modules and how to use them)https://sly.readthedocs.io/en/latest/sly.html
- Greg8128
-
500+ posts
Writing your own programming language
You don't really need much. A parsing library might help but you can use a handwritten lexer and parser for simpler languages. any tips on making a language in python? (eg useful modules and how to use them)
- ScratchCatHELLO
-
1000+ posts
Writing your own programming language
any tips on making a language in python? (eg useful modules and how to use them)
Sly is a good library for writing lexers and parsers: https://sly.readthedocs.io/en/latest/sly.html
The docs aren’t very detailed from what I remember (and there isn’t really much community documentation) and I couldn’t figure out how to get anything other than statements to actually work right
- linearlemur
-
500+ posts
Writing your own programming language
any tips on making a language in python? (eg useful modules and how to use them)
Sly is a good library for writing lexers and parsers: https://sly.readthedocs.io/en/latest/sly.html
The docs aren’t very detailed from what I remember (and there isn’t really much community documentation) and I couldn’t figure out how to get anything other than statements to actually work right
Ply: https://www.dabeaz.com/ply/ply.html
- jvvg
-
1000+ posts
Writing your own programming language
I built a programming language in Java once. The language is called Arrow, and the syntax basically uses text arrows to indicate control flow.
Check it out on GitHub.
The main control structures are:
If statement:
Loop:
Function:
Check it out on GitHub.
The main control structures are:
If statement:
/--< condition //skip the body if this is true
| //body
\-->
Loop:
/-->
| //body
\--< continuation condition
Function:
/--> returntype function(type1 arg1, type2 arg2)
| //body
^ return value
- Greg8128
-
500+ posts
Writing your own programming language
Interesting! I built a programming language in Java once. The language is called Arrow, and the syntax basically uses text arrows to indicate control flow.
Check it out on GitHub.
The main control structures are:
If statement:/--< condition //skip the body if this is true
| //body
\-->
Loop:/-->
| //body
\--< continuation condition
Function:/--> returntype function(type1 arg1, type2 arg2)
| //body
^ return value
- Jonathan50
-
1000+ posts
Writing your own programming language
See chapters 4 & 5 of Structure and Interpretation of Computer Programs. (Why haven't I read through SICP in its entirety and done all the exercises?)
There's a lot of very cool material there, like a logic programming system (like Prolog) which I copied in Snap!.
There's a lot of very cool material there, like a logic programming system (like Prolog) which I copied in Snap!.
- Greg8128
-
500+ posts
Writing your own programming language
Structure and Interpretation of Computer Programs. (Why haven't I read through SICP in its entirety and done all the exercises?)Wow, that book is free! Guess I don't have an excuse to not read it then See chapters 4 & 5 of
There's a lot of very cool material there, like a logic programming system (like Prolog) which I copied in Snap!.

Last edited by Greg8128 (June 12, 2021 02:15:00)
- ScratchCatHELLO
-
1000+ posts
Writing your own programming language
i had a language idea for a language that has no if statement, loops, functions, etc but only GOTO and GOBACK but it's probably already been done
here's a cool language idea I found: Z (not by me)
instead of writing params horizontally
you write them vertically
there's a bunch of other cool stuff too and I hope this becomes more well-known because it's really interesting
here's a cool language idea I found: Z (not by me)
instead of writing params horizontally
somefunction a b c
somefunction a
b
c
there's a bunch of other cool stuff too and I hope this becomes more well-known because it's really interesting
- skymover1239
-
500+ posts
Writing your own programming language
I have already written a programming language. However, it doesn't feel like a true programming language https://scratch-mit-edu.ezproxyberklee.flo.org/projects/432421352/
Is there anything I'm doing wrong?
Is there anything I'm doing wrong?
- Greg8128
-
500+ posts
Writing your own programming language
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/432421352/Having goto statements is OK but it's a good idea to provide more generic control structures (such as loops) that the programmer can use. I have already written a programming language. However, it doesn't feel like a true programming language
Is there anything I'm doing wrong?
- gdpr5b78aa4361827f5c2a08d700
-
1000+ posts
Writing your own programming language
interesting, i really want to learn rust to become an epic gamer and fiddle with things like this.
- mybearworld
-
1000+ posts
Writing your own programming language
I do want to write one (that's actually good), but I kind of stopped and failed after 10 lines. I have another idea how to make it though, let's see when I'll stop working on that one!