logoalt Hacker News

Fusion Programming Language

111 pointsby efreconlast Wednesday at 11:27 AM47 commentsview on HN

Comments

gr4vityWallyesterday at 9:23 AM

It seems similar in concept to Haxe, but focused on writing libraries which are then called from the target language, rather than building your whole application in Fusion. Is that correct?

How are exceptions translated to languages which don't have exceptions, like C?

The amount of targets seems impressive, but I don't see anything resembling a standard library. Usually, it's in the standard library where diverging behavior between targets shows up. Haxe's documentation tends to cover those issues, and lets you know when a behavior is target-dependent, or unspecified. They do try to be consistent between targets whenever possible in a performant way.

Loreline[0] is a recent project which leverages Haxe to build a cross-platform library. Is there a similar project showcasing how Fusion can be used for that?

[0] - https://loreline.app/en/docs/

show 1 reply
jdonaldsonyesterday at 3:41 AM

I'd love to see a comparison to Haxe. https://haxe.org/

I wonder what performance and generated code size/quality look like.

show 3 replies
poppadom1982yesterday at 9:15 AM

It's a nice idea but the C portion expects an array of unknown size, no bounds checking possible at all and it's also not returned how large the PNM image is. I also don't understand why glib is needed here to get the array to work. It's also missing the stdint.h include to be able to use uint8_t.

show 1 reply
eoanermineyesterday at 7:51 AM

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.

Panzerschrekyesterday at 5:31 AM

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

show 4 replies
FattiMeiyesterday at 8:08 AM

How (and why) are you targeting OpenCL? It has quite a different programming model

xiaoyu2006yesterday at 9:29 AM

Bad idea. It either takes a useless subset of all languages or do weird abstraction that wouldn't fit in a language otherwise.

andrekandretoday at 1:56 AM

from the example:

  public class HelloFu
  {
    public static string GetMessage()
    {
        return "Hello, world!";
    }
  }

translated into swift this gives a class, which means i'm dealing with reference semantics (and potentially threading issues) and probably not something i necessarily want... i tried struct, but there is no struct keyword in fusion it seems...
knhungyesterday at 4:55 AM

The idea it's good but hard to make it good. A universal language is hard to optimise for a particular language.

show 1 reply
anonzzziesyesterday at 7:45 AM

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.

teo_zeroyesterday at 6:38 AM

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. :/

show 1 reply
zabzonkyesterday at 9:27 AM

We seem to be regressing to the overuse of classes again.

hyperhelloyesterday at 5:45 AM

The syntax is so warm and simple, but not too simple. I like it, but I wonder how debuggable it can be, or if there is an interpreter for learning.

Alifatiskyesterday at 12:43 PM

I was a bit surprised to see Ds logo there. Cool.

jdw64yesterday at 4:08 AM

Wow, this is really fusion. I like it.

internet_pointsyesterday at 8:31 AM

but not Haskell, guess they gave up on picking a string type =P

hav0clast Wednesday at 11:46 AM

Reminds me of https://xkcd.com/927/

show 1 reply
hathymyesterday at 9:40 AM

Now we need an UnFusion programming language that can take code written in any language and convert it into Fusion. With that, you could transform any project from language A into language B.

show 1 reply
pelasacoyesterday at 9:13 AM

I like it. I just wonder if today transpiling is better then Agentic Programming. Any specific use case where i should use it? With a good model, SKILLS.md, AGENTS.md and prompts I am able to do - allegedly - a better job then a transpiler, no?

stefsyesterday at 1:53 PM

somewhat funny to the immature mind: "fut" - the name of the compiler binary - is austrian slang for vagina, but in the most obscene, vulgar way possible. a bit like "cunt", but worse.

preetham_ranguyesterday at 10:53 AM

[dead]

g42gregoryyesterday at 5:13 AM

What are the use cases? I am curious why Rust was not targeted.

show 2 replies
efreconlast Wednesday at 11:27 AM

Fusion is a programming language designed for implementing reusable components (libraries) for C, C++, C#, D, Java, JavaScript, Python, Swift, TypeScript and OpenCL C, all from single codebase.