r/computerscience • • Jun 19 '26

General DinoCode v0.2.0 - My own programming language built in Rust is now open source

Post image

I have been developing this idea for years. If you review my GitHub, you might find some very old, primitive versions from back when it was just an editor with an experimental language built in. I even wrote one of the very first iterations in AutoHotkey! However, this current version has nothing to do with that past chaos. It was written entirely in Rust.

What makes DinoCode different? The language design focuses on reducing syntax friction by using a principle called inference of intention. Traditional delimiters and symbols are optional. If you choose to omit them, the language infers what you meant to do based on logical rules detailed in my graduation research, which is written in Spanish since I am from Ecuador. Technically, the parser bypasses the traditional AST creation, emitting Reverse Polish Notation (RPN) bytecode directly to a custom stack-based virtual machine.

What is new in v0.2.0?

  • Real Interactive Console: It supports real-time keyboard inputs and execution pauses without freezing the browser main thread.
  • Live Flowcharts: As you type, the platform generates and updates a visual flowchart of your program logic instantly.
  • Bytecode Inspection: You can view the exact bytecode generated by the compiler and executed by the VM in real time.
  • Full Documentation: I personally wrote comprehensive guides, complete with executable code blocks right inside the browser.

I decided to open source the entire codebase. I hope it can be useful to anyone studying compiler design. The repository is wide open for feedback, questions, Issues, and Pull Requests.

Link to Web Platform (Live Playground and Repo): https://dinocode.blassgo.dev

134 Upvotes

48 comments sorted by

View all comments

38

u/Dry_Day1307 Jun 19 '26

Before the inevitable comments asking if this is AI generated, let me clarify that no AI was used for the architecture, design choices, or core codebase. However, let us be real here. AI is built into almost every modern editor today and I use VSCode. I take advantage of the free autocomplete features because using available tools to speed up the workflow just makes sense, but I do not pay for any AI subscriptions.

The only thing I offloaded was translating several internal comments into English for convenience (I am a native Spanish speaker), though the core notes and logic remain entirely my own. For some of the file headers, I let the autocomplete generate but manually reviewed myself. Other than that basic assistance, the entire compiler is 100% manual effort.

6

u/[deleted] Jun 19 '26

[removed] — view removed comment

4

u/Dry_Day1307 Jun 19 '26

Thanks a lot for the kind words. I just hope people find it useful, be it in education or any other industry, so it doesn't end up abandoned haha. That's pretty much what we all want for our personal projects

12

u/emmowo_dev Jun 19 '26

your other projects have nothing to do with Rust (AHK,JS,Dart) and some, such as your Java even have completely stolen code (as in, literally contains Mandarin comments).

To go from a junior dev quality of code to an entire parsed language is extremely suspicious, and- WOULD YOU LOOK AT THAT. your text comment for some reason, uses the UTF-8 *en-*dash instead of a hyphen, you know, the symbol that looks near identical. Oh, and also that file happens to contain the regular emdash too.

you have blatantly lied and vibecoded this. Can't even hide it properly when you try to.

2

u/Puzzleheaded-Lab-635 Jun 19 '26

Why do you care this much?

If there’s something in the code you don’t understand or disagree with, you should call that out. That would be useful. But focusing on “AI artifacts” makes it seem like the goal was less about reviewing the code and more about finding a reason to drag OP.

Did you actually read the code and come away with specific technical objections, or did you mostly scan for signs of AI-generated work and build the criticism around that?

Genuinely curious.

8

u/emmowo_dev Jun 19 '26 edited Jun 19 '26

well as a language it reads like someone's idea of a really simplified BASIC (with macros) but merged with Bash and modern OOP without the benefits of either. I know it's turing complete so in theory anything is possible, but it just feels odd.

That's part of my initial thought, because it didn't seem like a sound implementation, especially as an object-oriented language which I feel nowadays calls for at least an ability to hint type like in Python.

Like for one, the handling of 'functions' in this language feels like a compromise between the existing C-style method, and whatever they're trying to do with the whitespaced args.

like having no AST means that you cannot implement functionality such as functions in the properly efficient manner, and you can't really do proper optimizations outside basic simplifications.

My overengineered 1kloc, half-JSON dialog scripting language has more granular control flow since I implemented regex and switch-cases halfway through to reduce the amount of writing I had to do for a game.

0

u/Dry_Day1307 Jun 20 '26

DinoCode completely bypasses an AST to implement a direct syntax-directed translation. It is a deliberate decision to validate an fast pipeline from source code to bytecode in a single pass knowing perfectly well that AST level optimizations like dead code elimination are more difficult to achieve without a tree structure.

The Inference of Intention allows omitting delimiters without falling into context sensitive grammars granting total freedom to use a classic syntax when required. The following example is totally valid in DinoCode and is documented because you can write delimiters if you like since you are not forced to omit them and you have full freedom.

print(1, 2, 3)

The technical core is tracking logical continuity during lexing. By using boolean states the lexer identifies whether an operator is unary or binary before the tokens even reach the parser. This avoids the overhead of AST level optimization tricks and accelerates parsing.

Correctly interpreting a unary operator in implicit calls without parentheses is a major design challenge in the lexer compared to processing the common structure.

print -1

Instead of forcing the traditional syntax.

print(-1)

To resolve this I apply Artificial Breakers in the lexing phase proving that you can achieve a language optimized for bytecode. In the end I did not necessarily follow the most conventional or easy path but it is the path I wanted to take in the design of this project because that is how I envisioned it and not because I was unaware of conventional architectures

-1

u/Dry_Day1307 Jun 20 '26 edited Jun 20 '26

A common mistake is to think that a language without an AST cannot optimize at all when the reality is that these languages originally used syntax-directed translation and it was highly efficient. Historical languages like Pascal and early implementations of C heavily relied on this single-pass model to achieve incredible compilation speeds. It was simply set aside over time due to the complexity of maintaining it as languages grew and not for any other reason

Funny enough if you ask an AI to design a programming language today it will automatically generate an AST because it is the most conventional and easiest path for an AI to take but I preferred a different way even though I have seen many other language projects using an AST that are also highly interesting

1

u/Solisos Jun 21 '26

For someone as seemingly unemployed as you, you sure have a lot of things to ramble about.
On a serious note, what do you do for a living?

0

u/Dry_Day1307 Jun 19 '26

And what does that mean...? Yes, I used autocomplete (which in all modern editors is AI-powered) in comments, especially file headers, as I already mentioned, so... I don't quite understand the point. Also, just because not all my projects are open source doesn't mean I lack experience. Some are simply for companies or institutions and are private. I also have several personal projects that are private. And if you look closely at my profile, you'll also see I have experience working at a low level with Android's Dalvik VM. I've always been fascinated by these topics. I wrote this code by hand in Bytecode, if you'd like to review it:

https://github.com/BlassGO/App_Manager

I don't want to argue because I understand your reasons, but I'd also like to present mine

5

u/emmowo_dev Jun 19 '26

but your code is completely barren. I can't see any comments, and your bytecode intermediary can be converted to/from trivially.

It just does not resemble even 'undocumented' production code that I have seen in the real world at all. And, the fact that AI has clearly made its way into implementing functions means you have lied on some level.

-2

u/Dry_Day1307 Jun 19 '26

In fact, there are comments, but honestly, I'm not big on commenting absolutely everything. I only left notes on what I considered most important, especially in the Lexer, which isn't amnesic. Unlike the typical Chomsky hierarchy, I opted for the Lexer to be intelligent and resolve many ambiguities that simplify my parsing. The parser, more than just a parser, is the compiler to Bytecode for this representation. So maybe they weren't the best names haha, but ask an AI to imagine all the rules and behaviors in my project and see if it can pull it off. I've interacted with AI and I know its current limitations. That's why I prefer using autocomplete, because you're less likely to get errors than when using its agentic modes, where it surely won't be able to follow even the flow of my Lexer. If you look closely, there are comments, but in areas where I personally thought it was more appropriate to put them. For me, it's not necessary to comment everything if the identifiers themselves are already clear enough. I usually explain more logic. You can look around there in the parser too, I must have left comments in critical areas that can be confusing, like the deferred processing of IsMatch, InMatch, and many other things that are very interesting if you take the time to analyze the code and its flow, because it's not entirely linear since I use RPN ordering

2

u/Proud_Initial_4285 Jun 20 '26

"let us be real here" and other comments, including stolen code, generated code as well. How sick is that and stupid. Shouldn't be proud of that, since it doesn't even work well

0

u/Dry_Day1307 Jun 20 '26

I assume you’ve actually reviewed the codebase. If so, could you point out exactly what "doesn't work well"? I posted this here to get real, constructive feedback from people who know what they are talking about, but I don't see any technical arguments in your comment

2

u/Proud_Initial_4285 Jun 20 '26

Oh my god.Look at the code yourself...parsing a list of negative numbers or dealing with deep,nested structures can confuse the lexer/parser,leading to silent failures or misinterpretations of logic,NaN == NaN as true was probably??done to prevent unexpected crashes in data structures,but it breaks standard mathematical specifications.Objects utilize a prototype-based inheritance system,similar to JavaScript,maybe,but because delimiters are optional,modifying object properties or handling deep prototypes can EASILY leak or shadow variables if the parser incorrectly infers structural boundaries. How's that any good... 

0

u/Dry_Day1307 Jun 20 '26

The NaN thing is currently being discussed in the r/ProgrammingLanguages community, and precisely thanks to the recommendations they gave me, I'm going to leave NaN alone (in fact, it's easier to do it that way). Regarding the delimiters, inference isn't black magic, it's deterministic. I explain it in my academic thesis (even though it's in Spanish). When I designed the language, I specifically wanted to avoid unpredictable behavior, so I analyzed the predominant languages. That's why omitting them is mainly used where you waste time typing delimiters. What's the point of using commas in a list of strings? In fact, the behavior in C or Python is to concatenate them, which I find even more catastrophic. That's why there are no implicit operators in DinoCode, only delimiters; implicit operators do seem problematic to me. And again, you are free to use delimiters wherever you see fit, such as in complex structures. In fact, this example is valid and also quite readable:

person = {
     name "John"
     skills ["programming" "design"]
     contact {
         email "john@email.com"
         phone "123456789"
     }
     idk: [1, 2 , 3]  # Classic syntax is valid
}
 
print person.skills[0]

0

u/Solisos Jun 20 '26

No need to explain anything. Just ignore the whiners.

1

u/Proud_Initial_4285 Jun 26 '26

Ofc🤣 asking for a review and then blatantly ignoring it. Smart move! " deceived the conductor - bought a train ticket, went on foot".. 

0

u/plsloan Jun 20 '26

Did you add a VSCode extension for the language as well?

1

u/Dry_Day1307 Jun 21 '26

Hi, It would definitely be a great addition, and it is on my to-do list. For now, I have been focusing mostly on the website's interactive playground.

There are some very specific language rules in DinoCode that might be a bit tricky to implement in a code editor like VS Code, but I will figure it out once I dive into it. At the moment, I am using Lezer with CodeMirror for the syntax highlighting on the website