8 ms·
Fusion Programming Language
- efrecon 3mo agoFusion 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.
- hav0c 3mo agoReminds me of https://xkcd.com/927/ https://xkcd.com/927/
- deleted 3mo ago[deleted]
- jdonaldson 3mo agoI'd love to see a comparison to Haxe. https://haxe.org/ https://haxe.org/ I wonder what performance and generated code size/quality look like.
- nine_k 3mo agoApparently Haxe cannot target OpenCL. It can target PHP and Lua instead.
- jp3141 3mo agoFrom https://github.com/fusionlanguage/fut/discussions/119#discussioncomment-7088954 https://github.com/fusionlanguage/fut/discussions/119#discus... > I've read about Haxe in 2000s, before I started my work on Fusion. They have different design goals: in Haxe you create whole apps, in Fusion you create components to be used from other languages. Haxe has syntax similar to the (now dead) ActionScript, Fusion is similar to C#. Fusion transpiles to C, D, Swift, TypeScript, OpenCL and Haxe does not.
- broken-kebab 3mo agoBut what is the goal of Fusion then in pragmatic words? E.g. Haxe helps to save on development costs when targeting multiple platforms with emphasis on graphical interactive apps (games mostly).
- raphinou 3mo agoAt a time I was very interested in haxe, but their focus on games made it (perceived as) lacking in the area I wanted to use it (cross platform client-server apps). Recently rust seems to have taken this role for me.
- jdw64 3mo agoWow, this is really fusion. I like it.
- knhung 3mo agoThe idea it's good but hard to make it good. A universal language is hard to optimise for a particular language.
- nine_k 3mo agoThe point, AFAICT, is not in using all capabilities of all the target languages. Rather, it's about expressing some narrower class of computations and grafting them seamlessly into the target languages. Think of data formats, parsers, network protocols, stuff like handling and rendering of text, etc.
- g42gregory 3mo agoWhat are the use cases? I am curious why Rust was not targeted.
- nine_k 3mo agoI suppose you can write various algorithms in it, and have that code natively trsnspiled to different languages, for ease of native interoperability. It's unlikely to produce the absolutely most optimized code, but the lack of the interface translation barrier (aka FFI) may more than compensate for it. Rust is not easy to target efficiently, due to the borrow checker, and they likely don't want to dyn Box everything.
- NonHyloMorph 3mo agoI first thought you were going to ask about the usecases for the austrian fut lol
- Panzerschrek 3mo ago> 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.
- 4k0hz 3mo agoI 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 language that can work with that (i.e. any language).
- BobbyJo 3mo agoC code called from other languages has terrible ergonomics. Writing it sucks, debugging it sucks, maintaining it sucks. I don't know if fusion is the solution, but I know C isn't.
- 4k0hz 3mo agoIt can suck but it doesn't always. It depends a lot on the calling language.
- zigzag312 3mo agoWhat about a better ABI abstraction?
- imtringued 3mo agoThere 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.
- hyperhello 3mo agoThe 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.
- teo_zero 3mo agoNice 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. :/
- speps 3mo agoIt’s not a problem in practice if debug data is emitted properly. For example I used the VS Code C++ debugger extension with Zig.
- anonzzzies 3mo agoAs 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.
- eoanermine 3mo agoNice 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.
- FattiMei 3mo agoHow (and why) are you targeting OpenCL? It has quite a different programming model
- internet_points 3mo agobut not Haskell, guess they gave up on picking a string type =P
- pelasaco 3mo agoI 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?
- poppadom1982 3mo agoIt'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.
- deleted 3mo ago[deleted]
- gr4vityWall 3mo agoIt 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/ https://loreline.app/en/docs/
- harrisi 3mo agohttps://github.com/fusionlanguage/fut/blob/master/doc/reference.md#exceptions https://github.com/fusionlanguage/fut/blob/master/doc/refere...
- gr4vityWall 3mo agoThanks for the link. Seems like it isn't ready for general usage yet.
- zabzonk 3mo agoWe seem to be regressing to the overuse of classes again.
- xiaoyu2006 3mo agoBad idea. It either takes a useless subset of all languages or do weird abstraction that wouldn't fit in a language otherwise.
- hathym 3mo agoNow 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.
- crvdgc 3mo agoThat language should be called Fusion and this language Fission.
- NonHyloMorph 3mo agoNice. LessIsMore
- preetham_rangu 3mo ago[dead]
- Alifatisk 3mo agoI was a bit surprised to see Ds logo there. Cool.
- stefs 3mo agosomewhat 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.
- deleted 3mo ago[deleted]
- andrekandre 3mo agofrom 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...