Goose  History of bs/builtins/api/compiler.cpp of f1cab5f761a02435

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History of file bs/builtins/api/compiler.cpp at check-in f1cab5f761a02435

2024-09-15
20:24
Add clang format settings, reformat everything file: [a1232b0522] check-in: [0db147f117] user: achavasse branch: cir-ssa-refactor, size: 11773
2024-09-13
21:05
Drop in the most apocalyptic changes: new CIR instruction structure, new sequence builder, new compile time address representation, do almost just the bare minimum to compile again. A few simple things are still working somehow file: [3c3ff322fd] check-in: [57d4d0c79e] user: achavasse branch: cir-ssa-refactor, size: 11838
2024-04-09
22:55
Here we go again. Life is pain. Life is suffering file: [a6d7f234ad] check-in: [99c630bf0a] user: zlodo branch: cir-ssa-refactor, size: 11391
2023-12-06
20:49
Begin implementing structs. file: [495f86f001] check-in: [973848d259] user: zlodo branch: trunk, size: 11368
2023-08-02
21:46
Implemented forall statement file: [e9520a8555] check-in: [32f94cd2e1] user: zlodo branch: trunk, size: 11362
2023-03-27
18:34
  • reworked value wrapping in intrinsics, unwrapping can now only happen for the returned value (for verification reasons)
  • removed the _ConvertFuncArg extension point, replaced it with _ConvertFuncArgs that operates on all of the args (so that we can do cross argument things in the prelude, will be needed for lifetimes)
file: [b5a837f8b4] check-in: [f271454617] user: zlodo branch: trunk, size: 12028
2023-03-05
22:24
  • removed fmtlib, now use std::format
  • vastly improved the overload resolution debugging tools
  • prelude: started adding some extra error detection for small things that don't need to be builtin
  • prelude: started working on implementing #for for tuples, some stuff needs to be addressed still
  • fixed some type checking issue with wrapped args
  • fixed superfluous nested lifetime scope in brace blocks (which caused redundant calls to some extension points)
file: [7fd0dea580] check-in: [4d4d76607a] user: zlodo branch: trunk, size: 11838
2023-01-10
22:01
Implemented textual dump of a function's CIR to more easily inspect it and implement some code generation tests at the CIR level file: [6b25727cfc] check-in: [4edae7e1a3] user: zlodo branch: trunk, size: 11589
2022-06-11
12:29
Verification now mostly works again, tests not re-enabled yet file: [7567a36c9e] check-in: [17301ed8fc] user: zlodo branch: cir-stack-language, size: 10373
2022-05-16
23:40
Temporarily disabled codegen, verification, and all the tests that can't work without these file: [58b3735de0] check-in: [5fc7b0623f] user: zlodo branch: cir-stack-language, size: 9226
2021-11-11
20:05
Refactored the code builder: it is now carried around as a Value, and accessed through a bunch of extension points, so we can have different builders (and even user defined ones) later to make classes etc. file: [46160ae757] check-in: [1ad61a2717] user: zlodo branch: trunk, size: 9190
2021-11-03
22:55
  • References: ref now creates a template type accepting any kind of reference, and mut/const/temp are prefix operators turning that into a ref (or template ref) type of the corresponding kind (this also changes the syntax from ref mut XXX to mut ref XXX which is more natural)
  • Fixed the bizarely broken implicit referencing typechecking rule that performed a superfluous intermediate TypeCheck that crashed on non mutable template reference types
  • Fixed builtin function wrapper that omitted a cast of the return value to the specified type, which allowed builtin functions to silently return values of a different type than advertised, resulting in fun type checking errors
  • Fixed a bunch of fucked up return types that worked by chance (because of the above) in several g0 api functions
  • Implemented non mutable reference passing verification + related tests (it doesn't work yet but too many fixes need to be committed first)
file: [203b7092a8] check-in: [55994a469a] user: zlodo branch: trunk, size: 9220
2021-09-30
23:37
Fixed a couple of bugs, but the linux version is broken for now (due to language bugs that can't be worked around and need to be fixed) file: [6256d2f260] check-in: [24415e41e4] user: zlodo branch: trunk, size: 9192
22:07
Correctly generate and link executables on darwin file: [cd4287b2b2] check-in: [5f6197d1a0] user: zlodo branch: trunk, size: 9156
19:14
Added a builtin g0 variable that exposes the name of the target OS, just to be able to quickly hack around some rudimentary mac support file: [85f403dcf8] check-in: [ec5428614c] user: zlodo branch: trunk, size: 8841
2021-09-28
17:59
Fix functions and template functions not getting compiled with visibility over their original enclosing scope, but over the current scope at the point of invocation instead file: [c5f7d13631] check-in: [39c8a653da] user: achavasse branch: trunk, size: 8710
2021-09-20
23:23
Integrated the Tracy profiling client and added some profiling instrumentation file: [3a8d0eab02] check-in: [b846dfa2fb] user: achavasse branch: trunk, size: 8700
2021-09-19
16:06
Began implementing the prelude, which now sets up the g1 namespace, hiding all the internal builtins and APIs from user code. file: [418205c7dc] check-in: [15fd7eba11] user: achavasse branch: trunk, size: 8877
14:42
g0 api: #CompileFileToFunction takes the identity to use as root as parameter file: [66c9327c65] check-in: [dd5e98c20d] user: achavasse branch: trunk, size: 8994
14:23
g0 api: Env file: [c8d9e154e2] check-in: [0da72aac62] user: achavasse branch: trunk, size: 9033
13:59
g0 api: diagnostics file: [e19b99eb9a] check-in: [5ccfe91819] user: achavasse branch: trunk, size: 9037
2021-09-12
16:48
  • Started work on extensibility api
  • some code cleanup
file: [5b23d263e0] check-in: [55beba911a] user: achavasse branch: trunk, size: 9863
12:34
Renamed and modified bs/builtins/api/compiler.cpp → bs/g0api/compiler.cpp. Split out the compile time api function out of builtins and into their own library file: [a147be0fc3] check-in: [b397dc5a7c] user: achavasse branch: trunk, size: 9851
2021-08-31
23:10
  • Added extension points to transform parameter types and function arguments
  • Fixed the incorrect type predicate type checking rule which should just preserve the argument's predicates as is
  • Fixed verification of return intructions that were checking the returned value's predicates, instead of the return type predicates (which happened to work anyway until the above fix)
file: [fe95509156] check-in: [4b842721d2] user: achavasse branch: trunk, size: 9860
2021-03-02
22:51
Removed magic "tuple of types to tuple type" conversions and moved them into extension points so that any type can implement similar semantics file: [59b1fb2295] check-in: [2370e98869] user: achavasse branch: trunk, size: 9787
2021-02-25
12:10
Implemented a new method to order function overloads. Enabled several new reference tests which are now working properly. file: [be1f536131] check-in: [52ea24b083] user: achavasse branch: trunk, size: 9784
2021-02-21
17:15
Improved the #DumpValue debugging intrinsic file: [e5eb311584] check-in: [cb0fd19317] user: achavasse branch: trunk, size: 9783
2021-01-11
20:20
Reorganized symbols visibility a bit to avoid local variables from the enclosing function to be visible inside of function parameter list declarations (which prevented reusing them as parameter names). file: [e7fed90a72] check-in: [52280a3c5c] user: achavasse branch: trunk, size: 9666
2021-01-02
18:00
Some more renaming. file: [9e0e5f14cb] check-in: [0345b9f807] user: achavasse branch: trunk, size: 8759
2020-12-27
14:40
Renamed "ir" to "eir" (expression intermediate representation) and "llr" to "cir" (code intermediate representation) for clarity. file: [0b1e836161] check-in: [7d2def7b75] user: achavasse branch: trunk, size: 8765
2020-07-09
21:56
Cut of the verifier from the build for now. file: [58912c031d] check-in: [dad5591dee] user: achavasse branch: llr-stack-language, size: 8815
2020-06-26
23:34
Cleanup:
  • Removed the poorly thought out "domain" system that was intended to allow for different implementations of functions for runtime and for compilation time, which was adding an absurd amount of crap everywhere and should be unnecessary with the current planned approach for implementing data structures.
  • The using statement doesn't do lazy parsing anymore. Lazy parsing is better left to specific constructs that require them (such as function bodies and later on class/structs). This removes the only case of significant newline character in the language.
file: [bd63129957] check-in: [568c366a36] user: achavasse branch: trunk, size: 8765
2020-06-13
12:51
Modify the reference IR representation so that we can have holes for the behavior. file: [7338d9572c] check-in: [385846b609] user: achavasse branch: trunk, size: 9148
2020-05-25
22:08
  • Added a "LowerConstantForRuntime" extension point, similar to LowerTypeForRunTime.
  • Added a way to represent Record constants.
  • Implemented LowerConstantForRunTime for tuples, which lowers them into a constant record.
  • Implemented codegen for constant records.
  • Implemented codegen for storing an aggregate constant.
  • Implemented a way (not exposed in the syntax for now) to create vararg function types, to be able to call vararg external functions such as printf.
  • Enabled the tuple runtime/compilation combined test which is now working.
  • Various bug fixes.
file: [930ffd92af] check-in: [bb17e9f3dd] user: achavasse branch: trunk, size: 8949
2020-05-17
17:30
  • Clean up the "default return value from top level file functions" stuff.
  • Standardize to a default return value of 0 for the top level file both in execution mode and in compilation mode.
  • Implemented a combined execution/compilation test for tuples in preparation for implementing tuple compilation. (not enabled yet)
file: [9d739514d2] check-in: [397f594186] user: achavasse branch: trunk, size: 8563
2020-02-17
23:15
Register temporary values returned from function calls for destruction, so that DestroyValue() is invoked on them. file: [2c1dad4735] check-in: [a0ee0dfc2e] user: achavasse branch: trunk, size: 8400
2020-01-11
18:28
  • Moved the cfg and lifetime management stuff into a CodeBuilder object owned by sema::Context. This is in preparation to allow alternative implementations of the builder, for instance to build classes.
  • Pass the context to intrinsic functions, which removes their dependency to the parser the need for the ugly "GetCurrentParser" static function.
file: [b5e9670373] check-in: [b3aeaae2df] user: achavasse branch: trunk, size: 8408
2019-12-05
17:40
Implemented a helper to check whether a type is compile-time only. file: [ed057633e0] check-in: [12f37d77cb] user: achavasse branch: trunk, size: 8323
2019-11-18
01:40
Verifier: first seemingly working version of the k-induction loop checker. file: [18ca40d2ae] check-in: [477ef5b3d4] user: achavasse branch: trunk, size: 8374
2019-10-15
00:04
llr: implemented a helper function to compute dominators. file: [128126a45f] check-in: [cfc94e192c] user: achavasse branch: trunk, size: 7228
2019-10-09
19:21
Some renaming for consistency and to match commonly used names for those things. file: [6f4ac25870] check-in: [5e72e8e08c] user: achavasse branch: trunk, size: 7188
2019-10-05
14:50
verification: implemented a trace mode that only dumps the z3 expressions. file: [0b08aca32b] check-in: [0b95fe304a] user: achavasse branch: trunk, size: 7200
2019-09-29
22:30
  • Fixed some issues with implicit termination of void functions.
  • llr: give an index to each basic block, and keep track of back links towards previous blocks.
file: [1cb8ca46eb] check-in: [4ae6912760] user: achavasse branch: trunk, size: 6618
2019-09-22
14:37
Project renaming. file: [ab680901ce] check-in: [af650a9e95] user: achavasse branch: trunk, size: 7355
2019-09-16
21:38
  • func: created an identity for the verification expressions.
  • func: created bindings for the function parameters inside of the verification expressions identity.
file: [276d46fbde] check-in: [8abb611e48] user: achavasse branch: trunk, size: 7359
2019-08-27
20:27
Tuples containing only types or other tuples of types are now considered types. file: [da45e798f2] check-in: [533d2ce579] user: achavasse branch: trunk, size: 7357
19:46
Live values are now identified by an unique id to avoid using a fragile, non future proof way to extend the lifetime of local variables beyond their containing statements. file: [e5b43177d9] check-in: [39cabb3447] user: achavasse branch: trunk, size: 7356
2019-08-24
19:33
More cleanup around which builtin functions should be intrinsics/eager/non eager. file: [d918e677a8] check-in: [fece958df9] user: achavasse branch: trunk, size: 7356
16:54
  • ExecuteFile is now a regular builtin function.
  • Added #Include, which works the same as the old ExecuteFile.
  • Added a CreateConstant() builtin func.
  • Used the above to cleanup the command line parsing code in empathy.em.
file: [bce6656abc] check-in: [f1cab5f761] user: achavasse branch: trunk, size: 6305
13:42
Factored out the common code of Compiler::execute(), ExecuteFile() and #CompileFileToFunction(). file: [f40286f02b] check-in: [0c5641877d] user: achavasse branch: trunk, size: 5100
2019-08-23
20:18
  • Added a default InitializeVar() overload allowing any builtin type to be stored in a local variable during compile time.
  • Remplaced a lot of hackish uses of using with local variables, now that they work.
  • Changed several eager-evaluated bultin function to normal builtin functions, thanks to the above cleanup.
  • Eager-evaluated builtin functions are all now prefixed with a # symbol to indicate their "compiler directive" nature and make it clearer that they are evaluated during the translation phase of the program, rather than its execution (even compile time execution).
  • A few build and testing scripts fixes.
file: [b456dcb6ee] check-in: [133303cbbf] user: achavasse branch: trunk, size: 7401
2019-08-21
13:38
  • Automatically compile the samples during the build.
  • Added a --forcecolors to the front-end, since it can't detect whether colors are allowed when launched by Ninja.
  • while: if the condition evaluates to constant true and there is no break statement in the body, use a different code generation strategy to avoid generating a continuation block which makes a return statement mandatory after the loop even though it's unreachable.
file: [4cdbf5cb21] check-in: [20d317a921] user: achavasse branch: trunk, size: 7398
2019-08-19
13:43
  • Fixed many issues with compile time versus run time function invocations.
  • Improved some error messages.
file: [d164d23b7c] check-in: [baf9721752] user: achavasse branch: trunk, size: 7177
2019-08-18
20:54
  • Added a function to adjust the compile time execution budget.
  • lexer: Implemented escape sequences in string literals.
file: [c24970f281] check-in: [bd4456308c] user: achavasse branch: trunk, size: 7022
18:52
  • Implemented the break and the continue statements.
  • Fixed cfg generation issues with nested control statements.
  • Fixed unreachable code error messages not emitted in some cases.
file: [6420ce340c] check-in: [a504aedf6c] user: achavasse branch: trunk, size: 6495
14:51
  • Fixed speculative compile-time execution causing compilation failures.
  • Fixed compile time execution budget underflowing, leading to the compiler going into an infinte loop while compiling an infinite loop (erm...)
  • Fixed more cases of missing propagation of poison states leading to spurious error messages.
file: [009c385d1d] check-in: [9d81e31cfe] user: achavasse branch: trunk, size: 6481
00:54
  • Implemented the while statement.
  • Fixed a lexer issue that generated invalid locations at the very end of files.
file: [75e34f9174] check-in: [459ee84d6b] user: achavasse branch: trunk, size: 6327
2019-08-14
02:30
  • Added an unification rule to deal with LocationIds. It honors poisoning and preserve the most recent location from the input values.
  • Added a diagnostic context indicating the point at which a template function passed as a value has been instantiated.
  • Added a trace mode that logs the diagnostics contexts, which can be activated by calling a compile time function.
  • Added a few diagnostic messages tests.
file: [f7f36709e8] check-in: [980effe072] user: achavasse branch: trunk, size: 6324
2019-08-13
21:21
  • Completed the diagnostics renderer.
  • Fixed a few places where value poisoning wasn't correctly propagated.
file: [4222297e12] check-in: [ec58d0ff48] user: achavasse branch: trunk, size: 6098
00:42
Diagnostics: use value poisoning to (hopefully) fix most cases of superfluous cascading error messages. file: [402cd0689a] check-in: [59ecc02baa] user: achavasse branch: trunk, size: 5954
2019-08-12
20:15
  • Implemented a system to temporarily silence error outputs.
  • Syntax errors now silence further errors encountered while parsing the same block and nested children blocks.
  • All errors are also silenced while speculatively attempting to evaluate invocations at compilation time.
file: [ae46ea2692] check-in: [972c1d8b47] user: achavasse branch: trunk, size: 5826
2019-08-11
17:18
  • Converted more error messages to the new system.
  • Propagated value locations in some missing places.
  • Added the location of template function calls as diagnostics context.
file: [af576722ee] check-in: [b8548d8b24] user: achavasse branch: trunk, size: 5820
2019-08-10
19:33
Implemented a DiagnosticsContext class which can be used to push contextual informations that are printed when an error is emitted. file: [b089669b65] check-in: [ffa2c830dd] user: achavasse branch: trunk, size: 5077
17:50
lexer: generate token locations. file: [ecfea93975] check-in: [bd2fd03a33] user: achavasse branch: trunk, size: 4977
2019-08-09
19:54
Cleanup: got rid of the half-assed location and poisoning systems in ir::Terms. file: [6e5e7ee18e] check-in: [aee388d9c0] user: achavasse branch: trunk, size: 5057
2019-07-31
16:06
Function's llr representations lifetimes are now handled by Env, and function values only contain raw pointers to their LLR. This is to avoid leaks with recursive functions. file: [a8e4edf958] check-in: [1effb3a67a] user: achavasse branch: trunk, size: 5057
14:05
Fixed some cyclic reference issues with cyclic CFGs:
  • Moved and renamed sema::CFGBuilder to llr::CFG.
  • llr::Func now owns a CFG pointer, rather than a pointer to its entry BB.
  • Branch and CondBranch now store weak pointers to their target BB.
file: [de33c7b97b] check-in: [d19a6bf065] user: achavasse branch: trunk, size: 5058
2019-07-30
22:05
  • Builtin functions are now explicitely marked if they need to be evaluated eagerly.
  • Using errors out if the expression doesn't evaluate to a constant.
file: [b7ee83987c] check-in: [3c074f1b7d] user: achavasse branch: trunk, size: 5169
2019-07-27
13:04
Implemented external runtime functions. file: [e39ec0ad6e] check-in: [6a99df8278] user: achavasse branch: trunk, size: 5142
2019-07-26
22:30
  • Implemented an unification rule of ct_integer versus rt_integer.
  • Fixed multiple bugs related to compile time eager evaluation.
  • Fixed incorrect usage of CompileFunc which resulted in not actually calling the domain specific version of the function.
file: [3513c95323] check-in: [f31afce8ce] user: achavasse branch: trunk, size: 4774
01:50
Fix the Env never being deleted due to captured shared_ptr in some builtin functions which created reference cycles. file: [74b282bcb8] check-in: [1eb3c4a890] user: achavasse branch: trunk, size: 4563
2019-07-14
19:29
codegen:
  • implemented api to generate functions.
  • implemented tests for function generation.
file: [0806d3999b] check-in: [ab106469dd] user: achavasse branch: trunk, size: 4531
2019-07-13
23:30
  • Added missing quoting around function type's domain.
  • Detect and error out when an using expression is invoked recursively.
  • Fixed passing of generic values to builtin funcs (the pattern used was incorrect and didn't work when passing some types).
  • Added an unification rule to prevent single element tuples from being peeled off when unified against generic values.
  • Implemented an api function to compile a file into a function of a specified type and signature.
file: [68e2616984] check-in: [50da1401ee] user: achavasse branch: trunk, size: 4466
2019-06-19
19:49
  • parser: don't hardcode the builtins identity prefix in the rule helpers anymore.
  • builtins: move the common identity prefix used by all builtins into a separate function, to be able to easily change it.
  • builtins: prepend the CompileTime domain specifier to the root builtin identity.
  • sema: don't store the domain separately, extract it from the identity when needed instead.
file: [e98e062e20] check-in: [cde0c6d0e3] user: achavasse branch: trunk, size: 1489
2019-06-16
14:41
Added the current domain to sema context, and include it in function identities. file: [4b2a160834] check-in: [7e053c8063] user: achavasse branch: trunk, size: 1514
2019-04-13
22:03
Added: api: added a builtin Execute command, which executes the specified file. Also added the possibility to optionally return an error code. file: [286e5ac2f8] check-in: [47708770e6] user: achavasse branch: trunk, size: 1493