Debuggable
Rewind, introspect, elaborate, and fix.
Pre-alpha
Shim is a scripting language for embedded use in other applications, primarily game engines. It has many syntactic conveniences inspired by Rust, but with the ease of use of a scripting language like Python. This language was built to enable powerful developer tooling: hot reloading, time-travelling debugging, and deterministic replays. The tooling around the language is inspired by this tech demo from Tomorrow Corporation.
let W = 480
let H = 320
let G = 64
// Create a radial gradient texture with a soft blue color
fn build_glow() {
let px = []
let c = (G - 1) / 2.0
for y in 0..G {
for x in 0..G {
let dx = (x - c) / c
let dy = (y - c) / c
let d = (dx*dx + dy*dy).sqrt()
let b = (1.0 - d).clamp(0.0, 1.0)
let a = (b * b * 255).round()
px.append(((60 + b*155).round(), (150 + b*90).round(), 255, a))
}
}
create_texture(G, G, px)
}
let glow = build_glow()
set_canvas(W, H, scale=1)
draw_rect(0, 0, W, H, color=(4, 19, 38))
let frame = 0
fn loop() {
frame = frame + 1
// Fade previous frame slightly -> motion trails.
draw_rect(0, 0, W, H, color=(4, 19, 38, 30))
for i in 0..5 {
let t = frame * 0.03 + i * 1.256
let r = W.min(H)/4.0 + i * 7
let x = W/2.0 + t.cos() * r - G/2.0
let y = H/2.0 + (t*1.3).sin() * r - G/2.0
let s = G * (0.7 + 0.3 * (t*2).sin())
draw_rect(x, y, s, s, texture=glow)
}
}Press the play button to execute
Creating a new language is very impractical, particularly if you have a capable host language you can use instead. Shim is intended for use to extend a host application. If the host language can meet your needs, you should definitely use it. An embedded language should give you capabilities you can't get otherwise.
For Shim, the primary goal is to provide advanced developer tools, such as time-travelling debugging and hot reloading. Native debuggers don't provide these live interactive tools. Embedded scripting languages often have enough dynamism to patch in limited hot reloading, but without host application co-operation, time-travelling isn't possible.
Rewind, introspect, elaborate, and fix.
Quickly modify behavior and find/fix bugs.
Easy-to-learn with no footguns.
Hot reloading is feature complete, but much more validation needs to be done. The website playground and documentation need to be updated to reflect the current functionality.
Supporting time-travel debugging is "easy" since the Shimlang runtime stores all of its data in a linear chunk of memory. Saving and restoring this chunk of memory makes rollback easy. The hard part is creating an interface for systems outside of the interpreter to gracefully handle rollback and replaying inputs.
Hot reloading.
Time-travel debugger.
Type checking. Modules.
Ahead-of-time compilation.