I program in the pursuit of knowledge. Mainly I make programming languages
jansheikkinen / trinic Goto Github PK
View Code? Open in Web Editor NEWJust a programming language I felt like making
License: The Unlicense
Just a programming language I felt like making
License: The Unlicense
I know not how or why, but generation of the AST leaks memory according to my linter lol
The examples directory is filled with outdated representations of the language; all but one of the files have the extension .uc
instead of .tc
.
At the moment, a simple error like in the code rint(420).
produces the following error messages:
[PARSER ERROR]: (1, 5) Expected end of statement at (
[PARSER ERROR]: (1, 5) Expected expression at token (
[PARSER ERROR]: (1, 9) Expected end of statement at INTEGER
[PARSER ERROR]: (1, 9) Expected end of statement at )
[PARSER ERROR]: (1, 9) Expected expression at token )
In the end, I'd love this error to look more like:
[ERROR] (1, 5) Undefined function 'rint':
rint(420).
^^^^
My current priority is getting rid of the cascading effect caused by a single error. Five messages due to the result of a single error is unacceptable. There should be one message for every one error.
Ideally, I'd have the functions that can produce errors return some sort of Result type akin to Rust, and once a statement reaches its first error, just print that and move directly onto the next statement. It'd have to be a pretty bad error to involve more than one statement at a time, so this is generally a good way to prevent cascading errors. Obviously, if any errors are returned anywhere, execution should stop after parsing is complete. I believe that's how Crafting Interpreters did it, which I'm loosely following.
Furthermore, a lot of the current error handling was written haphazardly. In some points, I intentionally wrote the code in a way where I wouldn't have to handle any errors that arose. And a lot of the code that I did write could be extracted into a separate src/error/error.c
file, and it'd be pretty nice to clean all that up.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.