Compiling to WASM? #32

Open
opened 2020-05-22 06:27:22 +02:00 by radames · 15 comments
radames commented 2020-05-22 06:27:22 +02:00 (Migrated from github.com)

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

Hi, I'm big fun of this project for many years! Thanks for workin on it. Have you thought about compiling it to [WASM](https://developer.mozilla.org/en-US/docs/WebAssembly/C_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 commented 2020-05-23 22:07:59 +02:00 (Migrated from github.com)

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.

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 commented 2020-05-23 23:16:46 +02:00 (Migrated from github.com)

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.

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 commented 2020-07-24 23:57:47 +02:00 (Migrated from github.com)

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

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 commented 2020-07-25 00:00:13 +02:00 (Migrated from github.com)

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

oh by the way what is the highest resolution image I can generate; I want a 4000x4000 and beyond resolution :)
radames commented 2020-07-25 01:36:32 +02:00 (Migrated from github.com)

@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 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 commented 2020-07-25 17:26:35 +02:00 (Migrated from github.com)

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

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 commented 2020-07-27 01:57:29 +02:00 (Migrated from github.com)

deno support wasm and rust

deno support wasm and rust
tyty999 commented 2020-07-28 21:51:04 +02:00 (Migrated from github.com)
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 commented 2020-07-29 07:39:13 +02:00 (Migrated from github.com)

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.

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 commented 2020-07-30 01:47:11 +02:00 (Migrated from github.com)

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

cheer

thank for the head up, I'll test it out cheer
rubyFeedback commented 2021-03-01 21:02:48 +01:00 (Migrated from github.com)

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

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 commented 2024-09-14 23:10:33 +02:00 (Migrated from github.com)
work in progress here: https://github.com/azizghuloum/context-free/tree/wasm
azizghuloum commented 2024-09-18 06:58:12 +02:00 (Migrated from github.com)
screenshot

It pretty much works in the browser now.

<img width="1552" alt="screenshot" src="https://github.com/user-attachments/assets/8ca05694-1550-4262-8b5a-fc3c698d1957"> It pretty much works in the browser now.
MtnViewJohn commented 2024-09-18 07:46:33 +02:00 (Migrated from github.com)

This is astounding!

This is astounding!
azizghuloum commented 2024-09-27 07:38:14 +02:00 (Migrated from github.com)

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

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

Link to v0 (i.e., barely functional) of web-based IDE for context free https://azizghuloum.github.io/cfdg/
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: john/context-free#32
No description provided.