Opens profile photo
Follow
Click to Follow creationix
Tim Caswell
@creationix
Lover of all things good in life including Family, Friends, Food, and Functional Programs. ⚒️ Creator of luvit.io and nvm.sh 👨‍🔬 Protocol Wizard
Science & TechnologyRed Lick, TXmastodon.social/@creationixJoined September 2009

Tim Caswell’s Tweets

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
1
Show this thread
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
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
Replying to and
"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
21
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@60hz
    77.6%
  • 4K@30hz
    22.4%
49 votesFinal results
2
1
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...
Image
Image
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
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 Interpreter
    22.4%
  • Webassembly Interpreter
    26.9%
  • Lua Interpreter
    49.3%
  • Custom Intepreter
    1.5%
67 votesFinal results
5
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.
tim@Tims-MBP bin % time node -v    
v18.13.0
node -v  0.02s user 0.02s system 1% cpu 3.627 total
tim@Tims-MBP bin % time node -v
v18.13.0
node -v  0.02s user 0.02s system 1% cpu 3.636 total
4
1
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.
4 massive LiFePO4 batteries, lots of cables, an inverter/charger and a couple A/C chargers.
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