And while encantis is great for low-level wasm programming like the crypto samples, I feel there is still a place for higher level scripting.
is pretty well positioned here already. IIRC it has very minimal runtime and ABI requirements
Tim Caswell
@creationix
Tim Caswell’s Tweets
For the wasm language I'm designing, try it out at github.dev/creationix/enc
Make sure to install the encantis extension to get syntax highlighting and look at some of the samples like `samples/tee.ents` and compare to the wat version.
1
2
Show this thread
This is one example of what I mean by trivial custom interpreters.
twitter.com/creationix/sta
github.com/creationix/col
Quote Tweet
Replying to @creationix and @jfhbrook
I had one job where I was empowered to write a custom language and runtime. The entire VM including the bytecode interpreter and domain specific standard library was under 300 lines of C and I designed, developed and shipped the whole thing in a single week!
1
Show this thread
I'm trying to improve this in several areas.
- I can show that small DSVMs (domain specific VMs) are actually trivial to write
- I'm designing a higher-level language that directly targets wasm with no predefined ABI
- I'm researching the easiest to embed interpreters
4
2
Show this thread
- wasm is pretty good, but nobody writes wasm directly and using most languages that target wasm requires using a large and hard to sandbox ABI like wasi.
- domain specific interpreters are considered hard to create and maintain and by definition have no existing community.
1
Show this thread
The main problem is the existing popular scripting languages aren't quite embeddable enough:
- lua generally has poor security sandboxing, especially luajit
- JS engines are usually too complex and expensive to easily embed or don't support the full langauge or have no sandbox
1
1
Show this thread
Or your config format may have combinations of options that cause infinite loops or at least exponential costs when used at the same time in the ad-hoc config file interpreter. Once the design grows beyond a dozen or so properties, it's very hard to reason about all this.
1
Show this thread
For example, your config format may have regexps somewhere in it (which is often it's own turing complete language) and this can cause serious issues at scale in production.
If instead a simple bytecode compute runtime is used, the interpreter can limit the number of steps.
1
Show this thread
I understand that most scripting languages are turing complete and thus have the halting problem and most (though not all) config formats don't.
But an interpreter can sandbox against infinite loops easy enough. In fact it's easier to reason about runtime complexity this way.
1
Show this thread
This is especially good for larger companies where one team can focus on maintaining the generic compute runtime and one can focus on the API exposed to it and one can focus on writing and documenting the scripts.
1
Show this thread
The difference is the design is inconsistent since there is no language grammar or bytecode design. It's just arbitrary ad-hoc properties having different meanings.
Personally I prefer a formalized compute runtime with a defined platform interface.
1
Show this thread
Hot Take:
Interpreting JSON or YAML files to change application behavior is a form of dynamic scripting. It's not that different actually from say a bytecode interpreter.
3
1
12
Show this thread
Likewise, how about a generic rational type? I'm thinking of splitting it u32 for numerator and i32 for denominator.
So as small as +/- 1/2,147,483,647
and as large as +/- 4,294,967,296/1
Show this thread
Would anyone find it interesting to see the implementation of a decimal number type with 54 bits for value and 10 bits for power?
It can precisely represent at least 16 decimal digits and move the decimal 512 places either direction.
EX: up to ~90 trillion dollars and cents
1
2
Show this thread
"People" (researchers / students, actually) wanted Matlab, and Python had libraries that kind of looked like Matlab.
Lua(JIT) was a Lisp in disguise, much faster than Python and with the ability to drop to C easily. Much, much better for actual implementation engineers.
2
1
21
Replying to
We used Lua initially and started implementing a compiler for it.
But engineers hated it.
There were 3 other reasons to switch to Python:
1. People want Python
2. People want Python
3. People want Python
36
21
445
If I were to stream coding experiments, would you prefer 1080p@60hz or 4K@30hz as maximum quality?
I'm leaning towards HD60 since it's half the raw data and I prefer smoothness of frames. Also I'm not sure you can even see the difference for those a phone screen.
- HD@60hz77.6%
- 4K@30hz22.4%
49 votesFinal results
2
1
But today it was a little drier and we carefully unstuck the truck and then even more carefully moved the camper up the hill out of the mud!
1
6
Show this thread
The other day I got my truck very stuck in the mud trying to move our big camper to the repair shop. The front was buried up to the axles!
2
4
Show this thread
And this is the condemnation, that light is come into the world, and men loved darkness rather than light, because their deeds were evil.
John 3:19
I have three different ISPs right now complete with a 12,000ah@12v LiFePO4 mobile battery cart I built and I still don't have stable enough internet to do my on-call work this weekend.
I guess I'm signing up for a 4th ISP today...
1
2
Less than two hours left to vote on my silly poll ☺️
Quote Tweet
Which is fastest for very short scripts that need to be embedded in a native app?
Assume the host program is C, I want easy integration, pretty secure sandbox and very low latency for short programs.
The scripts are string manipulation heavy and may do some async I/O streaming
Show this poll
2
By "custom interpreter" I mean design a simple bytecode interpreter that walks over a binary AST (similar to webassembly, but domain specific to this one use case)
Show this thread
Yes I know this is a very subjective question. I want to know your opinions! Also feel free to explain what you picked and why.
1
Show this thread
Which is fastest for very short scripts that need to be embedded in a native app?
Assume the host program is C, I want easy integration, pretty secure sandbox and very low latency for short programs.
The scripts are string manipulation heavy and may do some async I/O streaming
- JavaScript Interpreter22.4%
- Webassembly Interpreter26.9%
- Lua Interpreter49.3%
- Custom Intepreter1.5%
67 votesFinal results
5
1
1
Show this thread
I could make my own IDE, the web platform can do all the things I want, but if I could join an existing ecosystem it would probably be better for everyone involved.
2
Show this thread
Does anyone know details about what extensions in vscode.dev can do? In particular, is it possible to create:
- virtual filesystems
- preview html using service workers
- language servers implemented as web workers
This would be amazing.
2
1
Show this thread
Box2D is moving from pointers to handles, and from C++ to C :)
15
48
447
Replying to
Creative coding on embedded devices. Being able to code & preview in a web interface and then push the binary to the embedded device over the air.
3
1
18
Hmm, I updated to the latest version of ventura and got rid of several programs I wasn't using and now it's fast.
Weird...
1
Show this thread
Does anyone know what makes some CLI programs like node sometimes really slow on M1 Pro systems with OSX Ventura?
I thought these were fast machines? I did verify the universal binary has the arm64 version.
read image description
ALT
4
1
Show this thread
Hopefully it's released soon and doesn't cost too much. The other RTX 4070 based laptops are coming out next month according to Nvidia.
Show this thread
Found the laptop I want! Hardware AV1 encoder and actual 3d display without glasses!
asus.com/us/laptops/for
2
Show this thread
One battery went out and things got all wacky. I had a couple extras i was using for the 12v system in the bigger camper and moved one over here. Now trying to charge the batteries back up and see if these victron balancers work.
read image description
ALT
1
"Most people think that power flows through wires because they are commonly used to transmit power, but in reality, it is the electric fields in the air that are responsible for transmitting power."
-Chat GPT
1
1
Show this thread




