Commit Graph

28 Commits

Author SHA1 Message Date
Nathan Braswell
e70d31a51c Add in address_of_ensure_variable_lower.krak that makes sure & can always take a reference, even of a constant, etc, and start the cleanup of c_generator that this allows 2017-10-22 21:41:58 -04:00
Nathan Braswell
1b0dce9ed1 Work on function value lower 2017-02-02 00:46:36 -05:00
Nathan Braswell
754ff41226 C_generator can call raw function pointers now 2017-01-28 00:09:13 -05:00
Nathan Braswell
5a6f498043 Working! 2017-01-21 22:01:47 -05:00
Nathan Braswell
e2639989c9 ref_lower now generates C, though a ton of syntax errors 2017-01-20 01:11:06 -05:00
Nathan Braswell
b0d2a6918d Regex rewrite for big speed gain, some extras (--no-c-compile), -O2 is default now 2016-08-02 01:33:16 -07:00
Nathan Braswell
523526f40e Improve arg parsing a bit, including parsing arbitrary flags for later use. Got (after a bunch of linker pain solved by just linking in LLVM-3.8 plain and not messing with llvm-config at all) a LLVM example working 2016-07-09 23:52:32 -07:00
Nathan Braswell
fb63eee9e8 Commit pre enabling CTCE pass (which is quite slow, but does work). Had to add walking through cast nodes for finding variables to close over. Also had to remove the static in front of functions to prevent gcc compiling it so that it segfaults (doesn't segfault if compiled with clang, but wanted to make sure.) 2016-07-09 15:08:57 -07:00
Nathan Braswell
dc5fe39083 Added static to non extern non main functions in c_generator giving a 12 second compilation speedup - added a nodes touched pass, commented out in main, and fixed the test_extern test to use the right printf arguments. 2016-07-06 22:46:57 -07:00
Nathan Braswell
a5deef8c30 Transitioned to using CTCE for Kraken compile information 2016-07-06 00:22:33 -07:00
Nathan Braswell
f71b5f3576 Init globals before lowering CTCE, allows CTCE to use imported functions, etc. 2016-07-06 00:16:39 -07:00
Nathan Braswell
0f2ac1421a Basic CTCE working! In between commit because #link(a) syntax changed to #link(a) 2016-07-03 22:50:42 -07:00
Nathan Braswell
6fee942756 Refactored interpreter into just functions, added a REPL to the main kraken. 2016-07-03 15:32:45 -07:00
Nathan Braswell
29eff2a23e Fix defer_lower to handle return statements, starting on obj_lower which has now taken over calling destruct for declared varaibles. Some of the code from the c_generator has been commented out or bypassed to use the new system - it should be removed when it's complete. 2016-06-22 01:41:57 -07:00
Nathan Braswell
26e7ee249a Now using adt_lower, which also makes the backing deconstruct a reference, which makes sense 2016-06-20 01:52:28 -07:00
Nathan Braswell
3f89cb1e37 partial rollback, might still not work 2016-06-16 09:53:15 -07:00
Nathan Braswell
d44293a48b Defer is now lowered in its own pass as a first step towards refactoring other things into their own passes as well 2016-06-15 01:36:59 -07:00
Nathan Braswell
27fea0e90c work on multithread, interpreter, and prototyped a #line-in-simple-passthrough ast changing pass turned on with -g 2016-06-14 02:14:25 -07:00
Nathan Braswell
59969e7114 Add passthrough optimization levels 2016-06-07 23:14:52 -07:00
Nathan Braswell
ce2eff42a6 Moved over compiler information printing and error to use stderr, enabled interpreter testing in tester. The interpreter passes 34/74 tests 2016-05-22 14:10:19 -07:00
Nathan Braswell
ce1afa45f4 Added a lot to the interpreter, but some odd problem where snprintf seems to print the wrong thing something like a 10th of the time. Debugged it for a while over two days, and I've narrowed it down to the actual snprintf call. It seems to happen under some different circumstances for compiled versions too, so I'm just going to keep it like this for now. 2016-05-18 23:11:00 -07:00
Nathan Braswell
e63b7cf770 Enough interpreter to do math on constant integers 2016-05-13 03:10:36 -04:00
Nathan Braswell
947384cced Started work on interpreter, commit to fix issues it will depend on 2016-05-12 02:03:20 -04:00
Nathan Braswell
7aa1d9983b Some bugfixes/added errors, convert most to not use simple_passthrough 2016-04-30 15:38:28 -04:00
Nathan Braswell
b52d38f648 Added in version numbers/hashes pulled from git - captain.sh generates at build time compiler_version.krak to be imported by kraken.main 2016-04-27 15:59:28 -04:00
Nathan Braswell
e732a6e41d Clean up for demo 2016-04-13 16:25:16 -04:00
Nathan Braswell
38ec4abc01 Added file name + line number to symbols and use it for reasonable error handling now, added a version number to the compiled grammer 2016-04-05 03:14:56 -04:00
Nathan Braswell
40c3e428c1 move test_compiler up to main kraken.krak and fix linker string, make paths work correctly 2016-03-28 17:12:53 -04:00