Commit graph

32 commits

Author SHA1 Message Date
liquidex 913d65b0a8 implement brush cost gauges
they're a little ugly at the moment, and can be a little useless for most simple brushes, but whatever we'll make them better later
2024-10-25 21:39:53 +02:00
liquidex 43e6951f7d fix crash occurring when a path cannot be created
this can occur if tiny_skia decides it doesn't like the path (e.g. circle with negative radius)
i don't really care to render these since they're degenerate cases anyways
2024-10-23 21:53:44 +02:00
liquidex b059ef4c35 fix broken with_dotter_identity test
probably broke after evaluation style changes
2024-10-23 21:52:36 +02:00
liquidex e19e47e6ad fix clippy lints 2024-10-23 20:45:34 +02:00
liquidex 7c40505d7d disallow running another reticle after a dotter 2024-10-23 19:46:23 +02:00
liquidex 37c575748b add support for vectors as operands to math operations 2024-10-22 21:58:32 +02:00
liquidex 5b7d9586ea introduce tags, structs, and reticles
this was meant to be split into smaller changes, but I realised I edited my existing revision too late.
2024-10-22 21:39:04 +02:00
liquidex 4430d6d125 add documentation for new math functions 2024-09-07 15:39:54 +02:00
liquidex 4bf3d685b8 add libm math functions to haku 2024-09-07 14:33:20 +02:00
liquidex 958cab5452 improve error reporting for missing else clauses 2024-09-07 14:31:48 +02:00
liquidex d309211558 allow up to 65536 parser events
parser events don't take up enough memory to warrant a stricter limit.
I do wonder if this limit is actually reachable with a 65536 character limit though.
2024-09-04 22:16:01 +02:00
liquidex 5e6b84bed5 cache busting
for faster load times, and seamless updates.
because for some reason ServeDir can't do it correctly, and it tells the client "yeah hey nothing changed" even if something changed
2024-09-04 21:50:30 +02:00
liquidex c1ccc1be24 fix an unnecessarily large amount of locals being emitted for each function
previously we'd create (argument_count + let_count) locals, which doesn't make sense.
so now `let`s use their own counter for their own locals, and we only request as many empty locals as there are `let`s.
2024-09-02 21:43:27 +02:00
liquidex 39989e555a fix SetLocal not taking into account the stack bottom
y'know, when you look for locals relative to the call frame's bottom, but then set locals relative to index 0...
boom.

closes #78
2024-09-02 21:39:04 +02:00
liquidex f4ceb0057e add a bunch of logging to haku, including vm-trace for tracing what the VM does 2024-09-02 21:36:38 +02:00
liquidex 337de0b57b return an error when the parser is at its event capacity 2024-09-02 20:41:13 +02:00
liquidex 26d3b8ed8a add a lot more logging to both client and server to analyze #81
> #81 Compiling brush doesn't seem to finish correctly sometimes, which causes loss of data
> Sometimes it seems like the client state can get desynced (server render thread dies due to a panic?) and then the server starts dropping all requests for drawing the brush.
> These panics should never happen of course, but we need better logging first to determine the exact cause.
2024-09-02 20:15:28 +02:00
liquidex a30c36c92a fix compilation errors on release mode due to missing #[cfg(debug_assertions)] with parser event tracing 2024-09-01 19:20:24 +02:00
liquidex ef1e35fcf0 remove redundant arity checking code from system functions, update error messages
the arity of unary and binary ops is guaranteed by the fact they're, well, unary and binary ops.
right now there's no way to call them with less or more arguments, so we may as well.
2024-09-01 19:15:58 +02:00
liquidex d1a6fb364e fix more syntax v2 bugs, update docs 2024-09-01 18:55:16 +02:00
liquidex 084012d65f parser debugging utilities + fixed paren sometimes producing unbalanced events
parser events now have a `from` field which has the source location of where the event was emitted.
this location is pretty-printed when using `Debug`
2024-09-01 10:03:21 +02:00
liquidex c5b2eb376f simplify Compiler lifetimes
the 2nd 'b lifetime parameter was not needed
2024-09-01 09:32:21 +02:00
liquidex 2595bf0d82 syntax v2
introduce a new, more ergonomic syntax for haku
not all features are implemented just yet. still missing:

- custom tags (non-True/False)
- color literals
- lists
2024-09-01 09:29:11 +02:00
liquidex 9cb24a0b1e remove unused imports 2024-08-24 16:12:41 +02:00
liquidex 6c88a041ea add SourceCode wrapping str for enforcing source code length limits at parsing boundaries
I'm actually quite happy with this API design. a little zero-cost wrapper that makes you _think_ when you need to think.
2024-08-22 20:49:16 +02:00
liquidex 3913254215 fix updated defs not being applied properly to VM in frontend and backend
this fixes the case where

	(def botsbuildbots (fn () (botsbuildbots))) (botsbuildbots)

would not run properly (return with a "set def index out of bounds" error)

also make exceptions store String instead of &'static str for better error reporting

closes #33
2024-08-22 20:27:18 +02:00
liquidex ccab723298 fill scribble 2024-08-22 17:50:39 +02:00
liquidex 7933057062 add rectangle and circle shapes 2024-08-21 22:07:59 +02:00
liquidex 50094c3872 add lists & VM memory limits 2024-08-21 21:11:22 +02:00
liquidex 2f7bcbb14e sync 2024-08-17 22:16:21 +02:00
liquidex 26ba098183 a whole load of work in progress 2024-08-15 20:01:10 +02:00
liquidex caec0b8ac9 initial commit 2024-08-10 23:10:22 +02:00