Top
Best
New

Posted by ibobev 2 days ago

Making your own programming language is easier than you think (but also harder)(lisyarus.github.io)
104 points | 56 commentspage 2
amelius 11 hours ago|
Making a programming language is easy if you just copy ideas already existing in other languages.

Coming up with new ideas is hard. Especially since you have to test them in the real world.

Panzerschrek 6 hours ago||
Just making a better C with no real compiler (only JIT) is easy, I agree. It's much harder to make something innovative and mature. It requires years of development.
virexene 13 hours ago||
this project is pretty interesting, although i'm wondering how they're planning to address the "easy sandboxing" design goal in a compiled language with raw pointer arithmetic and clib interop... in that regard i think lua would have been a lot easier to sandbox, despite the author's concerns.

(also, they might want to look into lua userdata, since that would address their concern about the overhead of converting between native and lua data structures. the language is designed to be embedded in C programs after all)

wg0 9 hours ago||
Strange to read that C++ can be someone's favorite programming language.

Only thing that goes for C++ is that it has acceptable (not straightforward) C interop.

I don't like C# and X++ because the language surface is huge but if you use a limited subset than needles to say, very useful and handy languages too.

debugnik 7 hours ago|
> X++

I was very deep into .NET until recently but somehow I didn't know this existed. Looks like C# with extra Linq-to-SQL syntax; I guess it's a DSL made with Roslyn for ERP jobs? I wonder how they picked the name.

ecto 11 hours ago||
There are many like it, but this one is mine https://loonlang.com
Decabytes 10 hours ago||
Like most things in programming, handling the easy stuff is easy, but it’s all the edge cases that kill you. I’m writing an IDE in flutter right now, and all of the defensive programming I have to do to handle the unhappy path, is where 50% of my code goes.
zenogantner 6 hours ago|
So maybe we need programming languages that are really good/supportive at handling errors (while not introducing more of them)?
Tomokisan 11 hours ago||
I watched a lot of youtube videos explaining in detail how to do it but i admit i never tried myself.

I'm kind of curious and want to try it for fun as long as i get some free time ^^

hyper_frog 6 hours ago||
Any reasons for not using odin? It seems great for gamedev
Panzerschrek 6 hours ago|
Odin has no destructors. That's a fatal flaw.
hyper_frog 6 hours ago||
well neither does C or zig right? but zig and odin do offer defer, which should be good enough while maintaining simplicity right?
Panzerschrek 5 hours ago||
defer is not a proper replacement for destructors. One need to write it manually each time in each function where some cleanup is needed. It's easy to forget to do so or to do this in a wrong way. Destructors in the other hand are called automatically and all cleanup logic is written exactly once (within destructor body).
BSTRhino 4 hours ago||
Great write up!
Razengan 9 hours ago|
For years I've been fantasizing about a language designed specifically for gameplay development that doesn't try to be like C.

Maybe AI is good enough now to help me with that..

The last time I tried, Claude couldn't even help me build a syntax highlighter for a hypothetical language.

zzo38computer 9 hours ago|
At least in my opinion, it might depend what kind of game. For example, there can be: card game, certain kind of puzzle games, Pokemon game, etc. There might also be consideration of such things like what portability you want, what sandboxing you will want, etc.

(There are game engines that have their own programming language for those kind of game (and some of them are the ones I had made up too).)

More comments...