Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling to WASM? #32

Open
radames opened this issue May 22, 2020 · 15 comments · May be fixed by #45
Open

Compiling to WASM? #32

radames opened this issue May 22, 2020 · 15 comments · May be fixed by #45

Comments

@radames
Copy link

radames commented May 22, 2020

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

@MtnViewJohn
Copy link
Owner

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.

@radames
Copy link
Author

radames commented May 23, 2020

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.

@tyty999
Copy link

tyty999 commented Jul 24, 2020

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 :)

@tyty999
Copy link

tyty999 commented Jul 24, 2020

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

@radames
Copy link
Author

radames commented Jul 24, 2020

@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?

@tyty999
Copy link

tyty999 commented Jul 25, 2020

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

@tyty999
Copy link

tyty999 commented Jul 26, 2020

deno support wasm and rust

@tyty999
Copy link

tyty999 commented Jul 28, 2020

I came across this while searching for Antigrain that the developer has pass away in 2013!
may it time to change the engine?? https://news.ycombinator.com/item?id=19581113

https://www.reddit.com/r/rust/comments/bmpmm0/a_pure_rust_2d_software_graphics_library/

https://github.com/jrmuizel/raqote/blob/master/DESIGN.md
https://github.com/DougLau/footile

@MtnViewJohn
Copy link
Owner

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.

@tyty999
Copy link

tyty999 commented Jul 29, 2020

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

cheer

@rubyFeedback
Copy link

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.)

@azizghuloum
Copy link

work in progress here: https://github.com/azizghuloum/context-free/tree/wasm

@azizghuloum
Copy link

screenshot

It pretty much works in the browser now.

@MtnViewJohn
Copy link
Owner

This is astounding!

@azizghuloum azizghuloum linked a pull request Sep 26, 2024 that will close this issue
@azizghuloum
Copy link

azizghuloum commented Sep 27, 2024

Link to v0 (i.e., barely functional) of web-based IDE for context free

https://azizghuloum.github.io/cfdg/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants