Commit Graph

44 Commits

Author SHA1 Message Date
nocturn9x 408d8cbeaa The REPL no longer shows the last pop value if an error occurs 2021-09-30 19:38:35 +02:00
nocturn9x a14d9a7882 Added simpleHashMap for internal use 2021-04-18 13:45:38 +02:00
nocturn9x f959693076 Minor fixes to VM because yes 2021-04-07 00:25:11 +02:00
nocturn9x 22d6408236 Moved to custom hashmap 2021-03-18 15:09:36 +01:00
Productive2 fb11433477 better compiler debugging
added test for defaults
2021-02-28 18:09:19 +01:00
Productive2 5d98814d7d improve debug vm
improved coloring
removed d:danger so debug output is present
fixed frame length debug output
2021-02-28 17:00:12 +01:00
nocturn9x 5d8c31fb07 Fixed identity operator bug and added isnot for consistency. Changed behavior for gt/lt comparisons to account for more complex expressions 2021-02-26 12:27:10 +01:00
Productive2 0a7db3ec0c Added printErr, tests to test the test suite 2021-02-09 16:59:34 +01:00
nocturn9x 9ffff11bf9 Added an optional prompt parameter to readline and renamed it to readLine. Added string support in toInt 2021-02-04 12:03:10 +01:00
nocturn9x 95522cd3c7 Minor style fixes to jats and fixed debug logs clashing when debug_vm and debug_alloc are both enabled 2021-01-31 10:51:29 +01:00
Productive2 76b92e85a7 new test notation (uses //stdout:, //stderr:) now
wip //stdin:
non-behaving tests get killed after a while now
added // exit and improved // clear repl commands
2021-01-30 18:42:04 +01:00
nocturn9x fb34faac2d Added a generic custom sequence implementation to replace nim's seq type and moved as much functionality as possible from nim to us in order to avoid GC clashes 2021-01-17 16:54:55 +01:00
nocturn9x 71f79d8174 Fixed various minor bugs, improved debugger output and consistency 2021-01-16 18:14:22 +01:00
nocturn9x e15e03764e Added support for 0-argument functions and lambdas without parentheses 2021-01-16 15:11:09 +01:00
nocturn9x f8ac8d08cb Removed short version of constants for benchmarking purposes and refactored the type system's behavior to return more consistent values 2021-01-16 11:47:01 +01:00
nocturn9x 882efd28da Separated string interning tests in compile-time vs runtime, fixed a bug in the build script and added some comments to the VM as well as a toStr function to obtain objects representations as strings 2021-01-14 22:37:11 +01:00
nocturn9x 56938897d6 Fixed precedence of is added beta support for the as operator for casting 2021-01-12 12:10:15 +01:00
nocturn9x 1e353ef1cc Fixed a precedence bug with the is operator and added getBoolean to OpCode.Not in the VM 2021-01-12 09:55:41 +01:00
nocturn9x 3eeffabe7d Added the retNative enum for native functions to handle singletons properly, minor refactoring in the parser and the vm 2021-01-11 13:17:01 +01:00
nocturn9x d0c6240b5a Removed some more duplicate code fragments from some opcodes 2021-01-11 08:42:05 +01:00
nocturn9x 064b3f087b Removed duplicate code fragments from some opcodes 2021-01-11 08:40:28 +01:00
nocturn9x c79095c99b Merge branch 'master' of https://github.com/japl-lang/japl 2021-01-11 08:07:02 +01:00
nocturn9x 410a557ce5 Fixed a bug with the compiler where it would crash with incomplete assignment expressions 2021-01-11 08:06:55 +01:00
nocturn9x 0b3614d1e7 Improved debugging output 2021-01-10 09:50:43 +01:00
nocturn9x 87fa674b15 Fixed a minor bug when calling natives with variadic arguments. Improved tests/runtests.nim and integrated the test suite in the build script. Added type(), round() and toInt() builtins to JAPL as well as the identity operator (revision needed). Got rid of an unused parameter inside frame.nim and cleaned up the VM's code by no longer using var parameters for the VM. Exception objects are now added to the VM's objects stack and variables used for debugging purposes are now only declared/modified when the debug flags are turned on 2021-01-09 18:03:47 +01:00
nocturn9x a58b8a9ef0 Removed unused/dead code + improved test suite code quality 2021-01-05 16:10:28 +01:00
nocturn9x cb5eb78ff7 Fixed a bug in the debugger regarding the output of the global scope. Re-added the del statement + small fixes 2021-01-05 14:55:37 +01:00
nocturn9x 875440ba8c Made print a variadic function and added clock() for benchmarking 2021-01-05 09:35:18 +01:00
Productive2 586522ce44 Added Natives
Added stdlib.nim
Added print
2021-01-05 00:32:17 +01:00
Productive2 383af42d76 Fix VM's SetGlobal pop
Fix Wrong loop constants
2021-01-04 23:22:27 +01:00
nocturn9x cead00061b Added interning for compile-time strings, made gc:markAndSweep the default option in the build tool and fixed a bug with the compiler where it would not free its memory if it encountered an error 2020-12-28 10:09:52 +01:00
Productive2 7d059bd50e Fixes call frames, Op.SetLocal 2020-12-26 20:05:45 +01:00
nocturn9x 1e8b4632e9 Attempt to fix function calls by using ref seqs (failed, lol). Now all math operations on nan raise a TypeError 2020-12-26 17:01:03 +01:00
nocturn9x 9e9dc3ac75 Removed a lot of redundant dereferencing in the compiler and fixed runtime objects memory leaking. Fixed some typos 2020-12-21 22:43:40 +01:00
nocturn9x d27cc60891 Moved the templates inside vm.run into separate procedures. Fixed a couple of logical mistakes and renamed SliceRange to Slice and Slice to GetItem. Added the cache optimization to other singletons (nil, nan, inf) 2020-12-21 21:53:45 +01:00
nocturn9x 18823ccf0d Fixed some of the bugs with function calls (recursion needs revision) and locals resolution. JumpIfFalse now always pops its operand even when the condition isn't met. Fixed a lot of typos inside types/jobject.nim caused by copy-paste errors and got rid of newString in favor of asStr 2020-12-21 18:37:08 +01:00
nocturn9x dba31dfba1 (Re-)Added bitwise operators and strings multiplication 2020-10-28 17:19:41 +01:00
nocturn9x 1b8b8d9096 Type system refactoring complete, some recursion debugging. Bumped up version to 0.3.0 2020-10-27 18:59:36 +01:00
nocturn9x ef08fee976 Base structure for some methods ready 2020-10-27 14:38:28 +01:00
nocturn9x 09e543d786 Fixed typos, minor improvements, added isCallable for objects 2020-10-26 22:55:20 +01:00
nocturn9x e87096ce71 Type system refactoring partially done, the VM is now at a compilable and semi-runnable state 2020-10-26 20:29:35 +01:00
Productive2 44aab6f5fc a few minor changes, so it compiles 2020-10-25 17:47:53 +01:00
nocturn9x b93643e5b5 Moved object structure to a single file + random stuff idk I'm tired 2020-10-25 15:08:08 +01:00
nocturn9x 673b88f9de Huge refactoring for the type system and object structure, VM needs opcode refactoring 2020-10-25 12:45:03 +01:00