spasm
spasm copied to clipboard
Some suggestions (sorry, no other place to post this)
Hi all! This is a really exciting project. The possibility of using Dlang on the client side blows my mind.
I'd like to make a few questions/suggestions and maybe can help contribute:
- How married are you to this project? I'm asking because I'd like to see how much progress happens over the next few years and even fork it and build new features for my current software business.
- Have you considered the possibility of using something like html mustache templates (Similar to Ractive.js, Vue, etc.) vs. writing structs? I think it would take me forever to write markup the way things are now.
- Do you see any hard limits on what developers can do with this vs. in JS? Maybe 3rd party libs?
- Also, it would be nice to have a discussion board here on git to talk about new features.
Thanks man. Very much appreciated.
I consider this project mainly an experiment. Out of it came the webidl bindings, as well as my more recent almost-finished efforts to port druntime to webassembly.
The structs in spasm are cute but have shown to have obvious drawbacks. At work I developed a DSL and a compile-time parser. It is a lot easier to work with. I do plan to take that experience and write a spasm v2, but time is limited.
I don't see any limits. The webidl bindings allow you to call any JS api, and there is an unfinished TypeScript bindings generator that allows you to call TS libraries. Most of that is spending a good week or two of getting that finished.
I see little need of a discussion board. I currently have plenty of ideas but no time to execute on them.
My goal for my project is for us to be 100% Dlang server and client side (share structs, types, non-server libraries, etc). With the exception of glue code, build scripts and other things that might be dependent on Nodejs and Javascript.
Wait...what? You almost have a port for druntime? This means we could use vibe.d's helper libraries like Json, std libs, etc? What about the GC and threads? Do those have support by wasm? Not sure how you do this, but that's pretty ingenious.
One idea I like a lot is to have compiled client side templates that can be used in a virtual dom. Would prevent a lot of sloppy mistakes made in these JS vue.js type libs that make it hard to trust what you write in the template. I'd like to do something similar to diet but without pug (rather just regular html).
Wait...what? You almost have a port for druntime? This means we could use vibe.d's helper libraries like Json, std libs, etc? What about the GC and threads? Do those have support by wasm? Not sure how you do this, but that's pretty ingenious.
Yep, almost there. Threads and Fibers won't be supported for now, but the GC is. There might be some weird edge cases, but I am almost running druntime/phobos unittests in the browser :)
This was the forum post announcing my proposal https://forum.dlang.org/thread/[email protected]?page=1
Ok, that's pretty out there. I've been waiting for that for a long time. The betterC+no allocations didn't work well for me the first time around.
Quick question, if threads are not part of it that means async code isn't a possibility at first right?
Either way, I'm pretty excited about druntime being in there. I have some fun things to do with that.