MtnViewJohn/context-free

Compiling to WASM?

Opened this issue · 12 comments

Hi, I'm big fun of this project for many years! Thanks for workin on it.
Have you thought about compiling it to WASM? It seems like a webclient would be a lot of fun, plus will be very accessible. It could use the canvas or webgl to render the drawings.I think this this codebase would be a great example of what can be ported to the web using WASM. Unfortunately, I'm still on baby steps on WASM otherwise I would jump into that idea. Cheers

I was just thinking about that the other day. It could use Ace code editor web component. I have experience in creating a single page application using the Elm language. This would be a great shelter-at-home project.

That would be very cool! I've been playing with an old js version(contextfree.js), but it's very outdated from your latest ContextFree API. https://observablehq.com/d/18ced937e9bd7ae0
I'd be happy yo help in some way, testing etc.

Wow, I'll be waiting!

Which file be the starting point if I want to do some coding? Is there any guidance for new code contributor?

Rust is great language for wasm that my tip :)

oh by the way what is the highest resolution image I can generate; I want a 4000x4000 and beyond resolution :)

@tyty999 I've heard about how Rust is great for WASM. I've been playing with https://emscripten.org/ and seems pretty straight forward with simple C/C++ code. The original context-free is written in C++. Would it make sense to reuse code rather than rewrite in Rust?

I believe there is already a c/c++ to rust like cython in python.
I just found this https://rust-gamedev.github.io/posts/newsletter-011/
https://ianjk.com/rust-gamejam/

radames : What the highest resolution can you get from contextfree I want to render at 4000x4000 is this possible

deno support wasm and rust

I can't remember what the maximum resolution is for the GUI versions of Context Free, but I'm pretty sure they can do 4000x4000. The command line version can definitely do greater than 10,000x10,000. I think it can go up to 32,768x32,768.

Maxim died in 2013, but a small group of people have been maintaining a fork of AGG 2.4. We are not adding new features, but bugs are getting fixed. I just updated the Debian package last week to work with GCC 10.

thank for the head up, I'll test it out

cheer

This would be really great.

I remember cfdg from many years ago by the way, which makes me quite an old dude at this point in time. :-)

I still have a look at cfdg every some months to check what's new! In particular the gallery - over the years
some people had AMAZINGLY creative ideas. I am nowhere near as creative, sadly. But on my todo list,
is a gtk-editor (in ruby-gtk3) for cfdg. I already had one working in ruby-gtk2 like 10 years ago or so but
that one has not been updated in years, so I am starting anew. Adding fewer features, but in a simpler
code base, and with more documentation - this should be more useful.

Anyway. What I actually wanted to add was this old webpage here:

http://korsh.com/cfdg/

It has not been updated in 16 years, sadly, but I always liked the idea.

My hope would then be that we could actually all simply set up a cfdg
online for people to use / re-use it (of course all adhering to the licence
in use). With the old approach like korsh, this depends so much on one
person, who tends to move on due to reallife and stuff, so things decay
and no longer work at one point in time. :(

So it would be great if WASM really becomes a success, to also be able
to have like cfdg on the www! Perhaps sandbox and isolated too.

(I sort of "work around" via ruby-gtk locally, but this isn't good for the www,
and I hate javascript ... if I can get away NOT having to use javascript
I am happy. I suppose it's not a big difference because I could use a
ruby wrapper and expose it via HTTP calls anyway, so a GUI is not
needed, but my long term dream is actually to use one DSL for the
GUI parts, for desktop and www-like GUIs. A bit like glimmer does, if
anyone knows it, but I know there are similar projects - one language
to rule them all. The GTK toolkit even has support for CSS or some
CSS, which is cool.)