How it works now:
User defines an external function:
noreturn ExitProcess(u32 uExitCode);
void main() {
ExitProcess(0);| Regular expression for matching error messages in Sublime Text. | |
| Insert into `file_regex` parameter of `.sublime-project` file. Then clicking the line with error message opens correct source file. | |
| --- Escaped for file_regex (\ -> \\) | |
| ^(?:\\s*)(?:.*(?: at |@))?((?:[^\\(: ]|:(?!\\d))+)(?:\\(|:)(\\d+)(?:(?:,|:)(\\d+))?\\)?(?:: (.*))? | |
| --- Raw regex (developed with https://regexr.com, used flags: global, multiline) | |
| ^(?:\s*)(?:.*(?: at |@))?((?:[^\(: ]|:(?!\d))+)(?:\(|:)(\d+)(?:(?:,|:)(\d+))?\)?(?:: (.*))? | |
| --- Matches |
| import std.stdio; | |
| void main() { | |
| foreach(kw; keyword_strings) { | |
| TokenType t = identifier_to_keyword(kw); | |
| writefln("%s %s", kw, t); | |
| } | |
| } | |
| TokenType identifier_to_keyword(const(char[]) tok) { |
| import std.stdio; | |
| import std.format; | |
| // First attribute goes into IN_TOKEN table | |
| enum State : ubyte { | |
| // intermediate states | |
| @(1) i_invalid, | |
| @(1) i_id1, // _a-zA-Z | |
| @(1) i_id2, // _a-zA-Z0-9 |
| // > vox hello_vox.vx && hello_vox | |
| // hello windows | |
| // > vox hello_vox.vx --target=linux-x64 | |
| // > wsl ./hello_vox | |
| // hello linux | |
| #version(windows) { | |
| @extern(module, "kernel32"): | |
| enum u32 stdin = 0xFFFFFFF6; |
| import std.array; | |
| import std.format; | |
| import std.string; | |
| import std.file : write; | |
| void main() | |
| { | |
| string dir = `D:/sources/my_sources/tiny_jit/test_work_dir`; | |
| foreach(s; [10,100,1000,10_000,100_000,1000_000]) { | |
| //make_source_c(dir, s); | |
| //make_source_d(dir, s); |
I measured my biggest code base written in Vox (which is mostly Vulkan bindings atm) and got the following numbers:
Source code: https://github.com/MrSmith33/voxelman/blob/master/source/voxelman/gui
Core widget components (https://github.com/MrSmith33/voxelman/blob/master/source/voxelman/gui/components.d):
focusedWidget on pointer press. focusedWidget will receive key and char events.| // Windows> vox fib.vx C:\Windows\System32\kernel32.dll | |
| // Linux> vox fib.vx | |
| i64 fibR(i64 n) | |
| { | |
| if (n < 2) return n; | |
| return (fibR(n-2) + fibR(n-1)); | |
| } | |
| void main() |
| import std.stdio; | |
| void main() | |
| { | |
| /* | |
| (vec2(1,5)-ivec2(9,9)).writeln; | |
| vec2 v; | |
| enum size = v.data.length; | |
| */ | |
| import std.math; |