Activity

2170251715

Almost 10 hours, so a devlog here.
This project is actually inspired by a lexer of lamina written in lamina itself, which is also written by me about half a year ago. So I wonder, if Lamina itself is sufficient in writing a lexer, what about a full language?
And now, after 8.5 hours of work, I have implemented a virtual machine and a bytecode compiler for Lamina, written in Lamina from the base of lexer (made minor adjustments to fit in latest syntax), now supports arithmetic calculations, comparisons, strings, lists, and global variables.
Compared with C++, Lamina is actually a very poor language. It’s arrays are immutable and cannot be created dynamically (you cannot create an array with a specific amount n of zeros, n is specified at runtime), and no key-value pair usable, so I have to implement them by myself using linked list. Every single place where you can see an array-ish object, the array-ish thing is actually linked list. Lamina itself is also a language made by teenagers and lack of maintenance, I have spotted loads of bugs while developing this LmLamina.
More devlogs will be posted when more time is wasted.
The source code will not be exposed to public before the whole project is complete.

Attachment
0
2170251715

I’m working on my first project! This is so exciting. I can’t wait to share more updates as I build.

Attachment
0
2170251715

I’m working on my first project! This is so exciting. I can’t wait to share more updates as I build.

Attachment
0
2170251715

I’m very happy here to announce that now Yaya can finally calculate simple arithmetic expressions (with correct precedence)!
I have almost completely forgot how to use stacks to evaluate infix expressions, and most tutorials online are not suitable for my special case. So it takes a while for me to figure out how to do it.
However after written this evaluation part I find out I can’t understand it again :( anyway at least it can actually work. Never mind let’s celebrate this great success!!!
(here is the core code of evaluation… can you understand it?)

Attachment
0
2170251715

A lot of work since last time!
When I started to write parser last time, I then genuinely fell down to a giant trap named expression. Indeed there are several well-developed ways on expression parsing, but my situation is really unique - in my language, the precedence of an operator can be resolved only at runtime. And this feature is very annoying…
So in the end, instead of start parsing directly, I choose to preprocess all the custom operator declaration first. After knowing which punctuations can be used as operators, the parser can process expressions more accurately - at least in my expectations.
What will happen next? Maybe we should just start coding before thinking.

Attachment
0
2170251715

A long time since the last devlog because of curricular issues.
Anyway, back again, here I am.
Since I’d created a complicated and messy syntax for my programming language Yaya, I had to take a lot of time on thinking which types of AST nodes are actually needed and which are not.
Writing AST nodes themselves were very tiring, so I wrote a simple script to generate AST nodes automatically from a sort-of description file. It works really well and saved me a lot of time.
Anyway, the next step should be syntactic parsing. There is still a long way to go…
(The quick expansion on LOC are all contributed by auto-generated AST nodes.)

Attachment
0
2170251715

Lexer is almost done!
Can’t expect I can write lexer this fast… but for the extensibility in the future, I actually give out a lot of accuracy on syntax, which accidentally boost my coding speed on writing a lexer.
Alright, let’s move on to the hardwork in parser… maybe?

Attachment
0
2170251715

Small fixes about specifications and struggling about the specific definition on token types. Bro why is this stupid specification still chasing me after.

It seems like my source codes would all be put in files like .hpp in the future. That’s indeed a great try for simplifying compile commands lol.

Actually seems nothing more than before…?

Attachment
0
2170251715

The very first version of the specification of Yaya is finally complete.
Writing documents are extremely painful… but at least there will be no more documents for a long time.
Now it’s the time for real coding.

Attachment
0
2170251715

The specification work took longer than expected… I thought it would be very easy, but the details had sneaked into every single corner. The specification is currently three times larger than the previous record in the devlog.
There will be more devlog about specifications until it’s finally complete.

Still cannot confirm when can start to write normal codes, not Markdown.

Attachment
0
2170251715

Well, actually this devlog is not about infrastructure again… but about specifications.
I wrote some simple regulations on a program written in my PL. Actually, the specification is even far from complete.
Writing specification is not fun… actually I used to write specifications for others, when writing a specification which has an already-made prototype, the experience is way more different from writing a specification from scratch.
Anyways, these documentary things are actually once and for all. After this there would be only less than one devlog about documents.

Attachment
0
2170251715

Everything starts small.
Though my ultimate goal is to make a programming language, but the basic infrastructure is also irreplacable. The standard library of C++ is not very handy, so I have wrote a few basic data structures (~700 loc) like strings with UTF-8 encoding, dynamic arrays, key-value storage based on AVL, and so on.
I still think the infrastructure is incomplete, so the next devlog should also be about basics.

Attachment
0