![](/static/0b35d4a1/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/8140dda6-9512-4297-ac17-d303638c90a6.png)
Can’t load this website, what is it?
Can’t load this website, what is it?
Thanks for your help my good man.
This is so nice… Thanks.
Understood. Thanks. I really wish they would allow people to upload their own games. Kinda like that old website (Newgrounds? idk).
++A; thanks! So, in a domain-specific language, like ASDL which I implemented, it’s mostly the denotational semantics at work, but in a GPL like C, it’s mostly operational. Am I right?
btw if you got the time, could you pls explain axiomatic semantics, that would be great. I don’t at all understand this one. Thanks.
This statement is completely wrong. Like, to a baffling degree. It kinda makes me wonder if you’re trolling.
No I just struggle at getting my meaning across + these stuff are new to me. What I meant was ‘Go does memory management LIKE a VM does’. Like ‘baking in the GC’. Does that make sense? Or am I still wrong?
I know about all this — I actually began implementing my own JVM language a few days ago. I know Android uses Dalvik btw. But I guess a lot of people can use this info; infodump is always good. I do that.
btw I actually have messed around with libgcc-jit and I think at least on x86, it makes zero difference. I once did a test:
– Find /e/ with MAWK -> 0.9s – Find /e/ with JAWK -> 50s.
No shit! It’s seriously slow.
Now compare this with go-awk: 19s.
Go has reference counting and heap etc, basically a ‘compiled VM’. I think if you want fast code, ditch runtime.
I think that happens when app developers learn2optimize. Stop using interpreted bytecode languages on small processors!
My man we have UNIX because PDP-11 was expensive!
I think by ‘GADTs’ you mean an AST (could be mistaken). In that case, it would not be a bytecode interpreter, it would be a tree walker. In most languages, an AST is translated down to bytecode, and passed to a VM execution engine. How this engine deals with closures is highly compliant on the architecture of the AST.
First, keep this in mind: A closure is just a closure at the higher-level. Job of the AST is to translate it down to ta more abstract form, thus, a closure would most probably be inlined. Otherwise, it will be a global subroutine defined somewhere on the stack. It never makes sense not to inline closures, unless that closure is a ‘hotzone’, e.g. frequently used, in whcih case you should most obviously define as a subroutine, and if possible, JIT.
A VM lke NekoVM has a higher-order, terse IR with which you can handle closures like you do in JS.
Don’t conflate higher-order constructs with intermediate representations. If you are interested to see a VM development in progress, star my RuppVM. Still early though. But i tend to work on it actively.
Thanks.
Are you specifying everything beforehand? If not, I’d recommend locking in on an ISA with stack effect pre-determined. Also, minimize as much as you can.
First off: Read Xia-Feng Li’s excellent book if you have not.
Then.
Here are some minimization tips I am doing for my RuppVM. I just began working on it less that 24 hours ago. But the tips are based on over 6 months of off-and-on trying to make a VM, and failing. I am sure this one will take, because of these minimization efforts:
ISA.txt
file, look at what I am doing for FFI. You don’t need intricate type mappings for the FFI. Just register a ‘hook’ to an address in memory (or ELF).These variables are not exactly portable, but you can use them, abuse them, etc:
extern etext
-> First address past the text segment;extern edata
-> First address past the initialized data segment;extern end
-> end of bssI think there are portable libraries for handling ELFs and PEs. You could also write your own Assembly code for it. For loading functions from files, for the FFI, these help a lot.
Another aspect you should implement is a ‘signal trampoline’. This trampoline will help handle signals from the OS, and hook it to your green threads.
Now, don’t take these as gospel. I am sure you know most of these already. But in case there’s new info, feel free to adapt it.
Star RuppVM, I will be adding a lot of stuff to it soon.
EDIT: I looked, there does not seem to be any ‘portable’ libraries for handling PE and ELF with the same interface. I guess ther can’t be, two different beasts.
EDIT 2: The FFI could prove to be much more complex than I thought? There’s libffi though.
I actually started work on a tool similar to Forth’s VMGEN. It will generate Stack VM’s in several languages leveraging m4, just like Bison. The difference between it, and VMGEN would be that it actually adds GC and threading. Based on Xiao-Feng Li’s book.
Ironically, I just made a thread on Gamedev instance about something like WASM, but for vidya. Except instead of WASM’s S-Expression I recommend a PostScript-like syntax. I gotta learn WASM.
Thanks.
I just remember about Noko! Also, there’s the one which Perl 6 uses. Forgot its name. Noko seems better imho. Need to look into BEAM.
Thanks!
Thanks. I actually have a parse-related question which I will post somewhere soon (as in 2-3 minute).
I will download it all and mirror it on my server and Github pages. Hate to see it go. What happened to this dude? Was he old or young?
True, but see, all these build up on the theoretical regex. The theoretical regex indeed has only 3 operators: dot for concatenation, pipe for alteration and the ‘kleene star’ [re: Sipser’s]. These 3 operators can express a finite state automata. You don’t really need all that other operators. Read this: https://swtch.com/~rsc/regexp/regexp1.html Algorithms like Thompson construction can translate a regex to a non-deterministic automata quite quickly, and then from there you can make a DFA or just simulate the NFA.
I would not call PCRE ‘regular expression’ really. If you read the article I gave you it explains why they are mostly a practical utility than a theoretical groundwork. The regex in use today is far from the regex one learns about in books.
I think regex is abused. People use it to parse context-free grammars. Extremely intricate and feature-rich patterns cause people to make mistakes, and end up with security holes!
That being said, I really enjoy NeoVim’s regex. I also like Perl’s. But I would not rely on them for parsing, or even lexing.
What should we talk about then, glob patterns (which are NOT regular expressions, for the love of all that is holy and unholy, stop calling glob patterns RE!)
Removed by mod