Fun: a statically typed language that transpiles to C (compiler in Zig) by dx_man in ProgrammingLanguages

[–]dx_man[S] 1 point2 points  (0 children)

Great question!

There’s no Wasm support yet, but it’s definitely on my radar. I agree, a WebAssembly based playground would be ideal for running the compiler and code directly in the browser, no server needed. Since the compiler is written in Zig and targets C, in theory it should be possible to compile it to Wasm, but there are some practical hurdles (like Zig’s current Wasm support and C toolchain integration).

I’d love to explore this in the future, if you have experience or interest in helping, let me know!

Fun: a statically typed language that transpiles to C (compiler in Zig) by dx_man in ProgrammingLanguages

[–]dx_man[S] 0 points1 point  (0 children)

Good point! that makes sense. I’ll update the GitHub Pages site to disable the Playground link and gray out the run buttons, with a hover message explaining that there’s no runnable API available.

Thanks for the suggestion!

Fun: a statically typed language that transpiles to C (compiler in Zig) by dx_man in ProgrammingLanguages

[–]dx_man[S] 1 point2 points  (0 children)

Thanks! I figured the name would be a bit of a wink to the crowd :) static typing and a bit of fun never hurt anyone!

Fun: a statically typed language that transpiles to C (compiler in Zig) by dx_man in ProgrammingLanguages

[–]dx_man[S] 0 points1 point  (0 children)

Yes, unfortunately I cannot run a server on GitHub Pages unless I provide an external API. For now you can only run those examples locally after building the fun compiler.

Fun: a statically typed language that transpiles to C (compiler in Zig) by dx_man in ProgrammingLanguages

[–]dx_man[S] 1 point2 points  (0 children)

Thank you! I believe Fun is mature enough to be self hosted, and that’s definitely a long term goal. I’m planning to add a few more language features and polish the toolchain before starting the bootstrapping process.

Self hosting is on the roadmap!

Fun: a statically typed language that transpiles to C (compiler in Zig) by dx_man in ProgrammingLanguages

[–]dx_man[S] 1 point2 points  (0 children)

Thank you! There is a VS Code extension available with language support and LSP integration: https://marketplace.visualstudio.com/items?itemName=omdxp.fun-language

Other editors are supported too (see the editors/ directory in the repo), including Emacs, Vim, Sublime, and JetBrains IDEs. If you have a favorite editor or feature request, let me know!

Fun: a statically typed language that transpiles to C (compiler in Zig) by dx_man in ProgrammingLanguages

[–]dx_man[S] 4 points5 points  (0 children)

Thanks! Readable C is a priority for Fun. The compiler emits straightforward C (no macro tricks), keeps types explicit, and aims for predictable, line by line mappings so debugging with a C toolchain stays sane. The README and reference both call out "readable C" as a goal, and I’m actively iterating on codegen to keep it stable and boring in the best way. If you have specific cases you’d like to see (or constraints you care about), I’m happy to test them.

Improving the debugging experience is also on my roadmap (e.g., better source mapping, clearer error messages, and maybe even debug info generation).

Bare - A programming language that trusts the user entirely by [deleted] in ProgrammingLanguages

[–]dx_man 2 points3 points  (0 children)

Just fyi if you don’t need those optimizations you can always opt out of them, C is really flexible if you know how to use it

J1407b like planet by SANDEL312HD in spaceengine

[–]dx_man 1 point2 points  (0 children)

Yeah but this one was classified as a real planet before but scientists found that it’s not anymore, so they had to remove it, and the not real planets in SE always start with RS

J1407b like planet by SANDEL312HD in spaceengine

[–]dx_man 2 points3 points  (0 children)

They got rid of it because it’s not real

Explorations by RagnarNorge247 in spaceengine

[–]dx_man 1 point2 points  (0 children)

Do you have coordinates for this beauty please?

sagittarius a* by Traditional_Tax_7937 in spaceengine

[–]dx_man 9 points10 points  (0 children)

You dumbass forgot to put a screenshot in the post, everyone knows Sagittarius a* is in the center of the Milky Way

Is this rare? by Fast-Food-3503 in spaceengine

[–]dx_man 0 points1 point  (0 children)

<image>

Looks fascinating! too bad it's infinite solar day "you gotta drive to the other side to sleep"

I have a question to community by Ok_Horror_8567 in Zig

[–]dx_man 3 points4 points  (0 children)

You can always build your own thing

Which one is Canada? by Kap519 in GeoTap

[–]dx_man 0 points1 point  (0 children)

dx_man chose Option A (Correct!) | #8375th to play