Live data from Hacker News

Fun 0.37.62 – The programming language that makes you have fun

fun-lang.xyz

1–10 of 16 posts

Re: Fun 0.37.62 – The programming language that makes you have fun

#2
What is Fun?

Fun is an experiment, just for fun, but Fun works!

Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences.

Influenced by Bash, C, Lua, PHP, Python, and a little Rust.

Fun is written in C(C99) and many libs are implemented in pure Fun. Smartcard(PCSC) is available as extension written in C while sha256 or sha512 are implemented in Fun.

Would love to get some feedback (hanez@fun-lang.xyz), but please read the content on https://fun-lang.xyz first.

Have fun! hanez

Re: Fun 0.37.62 – The programming language that makes you have fun

#4
post #2

What is Fun? Fun is an experiment, just for fun, but Fun works! Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences. Influenced by Bash, C, Lua, PHP, Python, and a little Rust. Fun is written in C(C99) and many libs are implemented in pure Fun. Smartcard(PCSC) is available as extension written in C while sha256 or sha512 are imple…

Looks interesting... ;) Thank You!

Re: Fun 0.37.62 – The programming language that makes you have fun

#5
post #2

What is Fun? Fun is an experiment, just for fun, but Fun works! Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences. Influenced by Bash, C, Lua, PHP, Python, and a little Rust. Fun is written in C(C99) and many libs are implemented in pure Fun. Smartcard(PCSC) is available as extension written in C while sha256 or sha512 are imple…

Looks interesting... ;) Thank You!

You're welcome! Would love to get some feedback!

Re: Fun 0.37.62 – The programming language that makes you have fun

#6
post #2

What is Fun? Fun is an experiment, just for fun, but Fun works! Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences. Influenced by Bash, C, Lua, PHP, Python, and a little Rust. Fun is written in C(C99) and many libs are implemented in pure Fun. Smartcard(PCSC) is available as extension written in C while sha256 or sha512 are imple…

How are you handling shared state with the new concurrency primitives? Since it is embeddable I am curious if you went with a global lock approach like Python or isolated states similar to Lua. Managing thread safety while keeping the C API simple is usually the hardest part of these implementations so I would love to hear more about the architectural choices there.

Re: Fun 0.37.62 – The programming language that makes you have fun

#7
post #2

What is Fun? Fun is an experiment, just for fun, but Fun works! Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences. Influenced by Bash, C, Lua, PHP, Python, and a little Rust. Fun is written in C(C99) and many libs are implemented in pure Fun. Smartcard(PCSC) is available as extension written in C while sha256 or sha512 are imple…

How are you handling shared state with the new concurrency primitives? Since it is embeddable I am curious if you went with a global lock approach like Python or isolated states similar to Lua. Managing thread safety while keeping the C API simple is usually the hardest part of these implementations so I would love to hear more about the architectural choices there.

I chose isolated state (like Lua) rather than a single global lock (like Python’s GIL). Each VM has its own heap, scheduler, and garbage collection. There are no cross-VM pointers. Concurrency and data exchange happen via message passing and a few carefully scoped shared-memory primitives for high‑throughput use cases. This keeps the C API simple, predictable, and safe to embed in multi‑threaded hosts.

Re: Fun 0.37.62 – The programming language that makes you have fun

#8
post #2

What is Fun? Fun is an experiment, just for fun, but Fun works! Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences. Influenced by Bash, C, Lua, PHP, Python, and a little Rust. Fun is written in C(C99) and many libs are implemented in pure Fun. Smartcard(PCSC) is available as extension written in C while sha256 or sha512 are imple…

How are you handling shared state with the new concurrency primitives? Since it is embeddable I am curious if you went with a global lock approach like Python or isolated states similar to Lua. Managing thread safety while keeping the C API simple is usually the hardest part of these implementations so I would love to hear more about the architectural choices there.

I added a section to https://git.xw3.org/fun/fun/src/branch/main/docs/internals.m... that describes this more detailed. I copied from other documents some seconds ago and I am not sure if this all is 100% correct actually. I will check this and will update the file if I find some wrong parts...

Re: Fun 0.37.62 – The programming language that makes you have fun

#9
post #2

What is Fun? Fun is an experiment, just for fun, but Fun works! Fun is a highly strict programming language, but also highly simple. It looks like Python (My favorite language), but there are differences. Influenced by Bash, C, Lua, PHP, Python, and a little Rust. Fun is written in C(C99) and many libs are implemented in pure Fun. Smartcard(PCSC) is available as extension written in C while sha256 or sha512 are imple…

I need to say, that issues can be opened at https://github.com/hanez/fun/issues, but I do not develop Fun on GitHub. Pull requests will not be accepted there. Send patches or ask me for an account on https://git.xw3.org... ;)

Re: Fun 0.37.62 – The programming language that makes you have fun

#10
post #8

Earlier quoted context omitted.

How are you handling shared state with the new concurrency primitives? Since it is embeddable I am curious if you went with a global lock approach like Python or isolated states similar to Lua. Managing thread safety while keeping the C API simple is usually the hardest part of these implementations so I would love to hear more about the architectural choices there.

I added a section to https://git.xw3.org/fun/fun/src/branch/main/docs/internals.m... that describes this more detailed. I copied from other documents some seconds ago and I am not sure if this all is 100% correct actually. I will check this and will update the file if I find some wrong parts...

Thanks for the link. I will take a look at the internals. The trade-off between global locks and isolated states is usually the most critical decision for embeddable languages so I am curious to see how the implementation handles it.
Post reply on HN