Live data from Hacker News

Fusion Programming Language

fusion-lang.org

21–30 of 53 posts

Re: Fusion Programming Language

#22
post #12

> implementing reusable components (libraries) for C, C++, C#, D, Java, JavaScript, Python, Swift, TypeScript and OpenCL C, all from single codebase Why is this needed? I can't imagine that. I am sure writing code in fusion will produce C++ and Python code which is suboptimal and doesn't fit well in these languages.

I think the target application is writing the same algorithm in multiple places with a guarantee that the logic will be based on a single source of truth. Not unlike Protocol Buffers work to standardize data layout across platforms. It still feels overcomplicated compared to the standard solution of writing a library in a compiled language you like, exposing a C ABI compatible interface, and hooking it up to any lang…

You don't need a C ABI here because the language could in theory generate both the library and the cross language bindings, the underlying mechanism then becomes a mere implementation detail.

I feel like there is a huge missed opportunity that Fusion Lang overlooked.

Re: Fusion Programming Language

#23
post #12

Earlier quoted context omitted.

I think the target application is writing the same algorithm in multiple places with a guarantee that the logic will be based on a single source of truth. Not unlike Protocol Buffers work to standardize data layout across platforms. It still feels overcomplicated compared to the standard solution of writing a library in a compiled language you like, exposing a C ABI compatible interface, and hooking it up to any lang…

What about a better ABI abstraction?

There is GObject, COM, C++/CX and WinRT.

I personally am thinking that developing more programming languages has stopped making sense a long time ago because all of them ignore this untapped market that would help more languages.

C based FFI uniquely privileges C the same way the dollar being a global reserve currency privileges the US, but in the case of currencies the differences in how they work are very small, but with programming languages the differences are substantial.

Half the people working on new programming languages should have been working on GObject competitors instead.

One of the things that is difficult to grasp is that the best FFI is not native to a specific programming language, meaning it does not privilege any specific programming language. Of course this doesn't mean that it cannot be heavily inspired by a particular programming language, it just means that the implementation must be common to all programming languages.

What I mean by the latter is that the features need to be implementable in all programming languages and the easiest way to do it is to define common data types.

The big fallacy that the C FFI advocates present is that it is somehow fine to require full C compiler infrastructure and the C standard library to parse C headers and produce the ABI, but somehow it is the height of evil to define a fat pointer as a C struct consisting of a data pointer and a function pointer and mandating every language to use it, because it is not a C native datatype and only the mythical programming language C is allowed to be used for FFI. I'm pretty sure half the battle could have been won by C having defined common datatypes for the sole purpose of ffi in its standard library.

Re: Fusion Programming Language

#24
As others say ; how does debugging work? I was a user of Haxe and Monkey and both had/have serious debugging issues; I think this can only work if it has an interpreter for itself (self hosted I guess ideally) with a proper debugger.

Re: Fusion Programming Language

#25
Nice stuff, I'm working on something like Kaitai Struct, and it'll be very convenient to codegen to Fusion, to support multiple target languages.

However, what I like the least in all kind of software is underdocumentation. There's some reference, it's not bad, but actually it's just bunch of examples. If I want to find out exactly how a particular type or statement translates into a specific language, I'll have to dig into the code.

Re: Fusion Programming Language

#28
post #12

> implementing reusable components (libraries) for C, C++, C#, D, Java, JavaScript, Python, Swift, TypeScript and OpenCL C, all from single codebase Why is this needed? I can't imagine that. I am sure writing code in fusion will produce C++ and Python code which is suboptimal and doesn't fit well in these languages.

I think the target application is writing the same algorithm in multiple places with a guarantee that the logic will be based on a single source of truth. Not unlike Protocol Buffers work to standardize data layout across platforms. It still feels overcomplicated compared to the standard solution of writing a library in a compiled language you like, exposing a C ABI compatible interface, and hooking it up to any lang…

> writing the same algorithm in multiple places with

This seems for me to be reasonable. Like for a video game with server written in Go/C++/Rust and client written in C#/Javascript, where the same calculations should be done on both sides.

Re: Fusion Programming Language

#29

Earlier quoted context omitted.

What about a better ABI abstraction?

There is GObject, COM, C++/CX and WinRT. I personally am thinking that developing more programming languages has stopped making sense a long time ago because all of them ignore this untapped market that would help more languages. C based FFI uniquely privileges C the same way the dollar being a global reserve currency privileges the US, but in the case of currencies the differences in how they work are very small, bu…

Exactly! It's surprising to me how little development is happening in this area.

Re: Fusion Programming Language

#30

Nice idea. I'm just wondering how to debug code written in fusion... probably you must focus on one of outputs, debug that one, and then back-fit the changes to the fusion source. :/

It’s not a problem in practice if debug data is emitted properly. For example I used the VS Code C++ debugger extension with Zig.
Post reply on HN