TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Onyx, a new programming language powered by WebAssembly

197 点作者 bkolobara超过 1 年前

21 条评论

crabmusket超过 1 年前
I would really like if the language reference[1] had a &quot;rationale&quot; or &quot;principles&quot; section describing the decisions at a high level. At the moment it dives straight into the minutiae of syntax, built-in types, etc.<p>The language marketing insists it is &quot;data-oriented&quot;, even in the footer of every page. But I couldn&#x27;t find any more detail on this.<p>My favourite example of this is Austral, which has a detailed rationale[2] that justifies the choices made and the tradeoffs. It really helped me decide whether I was interested in the language.<p>Odin, cited in the blog post, has a shallow rationale on its FAQ page[3], but seems to have had more time&#x2F;maturity to document specific &quot;data-oriented&quot; features like built-in SoA[4].<p>[1] <a href="https:&#x2F;&#x2F;docs.onyxlang.io&#x2F;book&#x2F;Overview.html" rel="nofollow noreferrer">https:&#x2F;&#x2F;docs.onyxlang.io&#x2F;book&#x2F;Overview.html</a><p>[2] <a href="https:&#x2F;&#x2F;austral-lang.org&#x2F;spec&#x2F;spec.html#rationale" rel="nofollow noreferrer">https:&#x2F;&#x2F;austral-lang.org&#x2F;spec&#x2F;spec.html#rationale</a><p>[3] <a href="https:&#x2F;&#x2F;odin-lang.org&#x2F;docs&#x2F;faq&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;odin-lang.org&#x2F;docs&#x2F;faq&#x2F;</a><p>[4] <a href="https:&#x2F;&#x2F;odin-lang.org&#x2F;docs&#x2F;overview&#x2F;#soa-data-types" rel="nofollow noreferrer">https:&#x2F;&#x2F;odin-lang.org&#x2F;docs&#x2F;overview&#x2F;#soa-data-types</a>
评论 #38494588 未加载
评论 #38496979 未加载
评论 #38497727 未加载
评论 #38495187 未加载
solarkraft超过 1 年前
It seemed inevitable that a new language would choose WASM as a runtime.<p>We get a bytecode runtime to rival JVM and CLR, but with a diversity of stake holders (no single vendor trying to push a language or enterprise offering), it&#x27;s JITed even on Apple devices and on the damn web! Pretty amazing.<p>What makes me excited about this: Getting to poke around, at runtime, my compiled .NET C# code using PowerShell (in Snoop) was pretty eye-opening to me. The &quot;standard&quot; interoperability between PowerShell (Core?) and .NET objects as well, of course.<p>It feels great to have a common runtime making calling out to other languages so seamless. Yet it seems to me like it never reached the popularity it deserved, but maybe it will get another try, with a lot more enthusiasm (no more Oracle&#x2F;MS brake-foot).
评论 #38497152 未加载
IshKebab超过 1 年前
Looks neat. Some obvious basic questions that I imagine most people would wonder:<p>1. Is it value based (C++, Rust, Go, TCL) or reference based (basically everything else).<p>2. How is memory freed? GC?<p>3. If GC how do you deal with the fact that Wasm GC is still in progress?<p>4. What about concurrency? Is it single threaded?<p>5. How does error handling work?<p>6. Does it support modern type features - Option&lt;&gt;, sum types, etc.<p>7. It&#x27;s imperative, does that mean things that should be expressions (e.g. if&#x2F;else) are statements?
评论 #38491910 未加载
评论 #38491723 未加载
kemitchell超过 1 年前
Clearly Wasmer wants to do WebAssembly. But for a whole new, general-purpose programming language, what&#x27;s the case for that target, versus, say, LLVM intermediate representation?
评论 #38491434 未加载
soulbadguy超过 1 年前
Well it&#x27;s Friday and i have some time to kill. Before i start, creating a language is hard and i am just making random comment on the internet.<p>From the &quot;why webassembly&quot; section :<p>&gt; When making a programming language, you need to decide how your programs will actually be executed.<p>In abstract maybe, and obviously some language features might make an interpreter or a compiler harder&#x2F;easier to make. But in general and in practice the language semantic and the &quot;execution mode&quot; can be treated independently. Some of the languages mentioned even have multiple style of execution (AOT, JIT, interpretation , compilation etc...)<p>&gt; Onyx does not rely on libraries like LLVM to generate its code, because WASM is so simple to target.<p>In term of correctness maybe. It will be interesting to see what happens as performance and more complex code pattern need to be supported. Most language evolve some type of high level representation between the AST and they target of choices for language specific transformation and error reporting (SIL,clangIR and HIR? not sure about that last one).<p>&gt;My strategy was to wrap libwasmer.a, the standalone library version of Wasmer, into my own custom WASM loader, to allow imported functions to be linked against native libraries<p>Doesn&#x27;t this both limit the portability and introduce potential security risk (and thus negating the whole point of wasm) ?<p>I think the inter reaction with the outside world is what WASI and the other is trying to address.
bnchrch超过 1 年前
I&#x27;m in no way against a new language! Love programming languages, particularly ones that push boundaries and challenge assumptions!<p>(Great work on that front btw Onyx Team)<p>But! When I see powered by WebAssembly. I can&#x27;t see a good reason to choosing a unique language when any language in theory can target WASM&#x2F;WASI.<p>In other words Javascript&#x2F;Python is looking at your lunch and is very hungry.
评论 #38492926 未加载
评论 #38493924 未加载
评论 #38493300 未加载
royjacobs超过 1 年前
How optimized is the generated code? One of the benefits of using LLVM is the amazing set of optimization passes, after all. Will Onyx have to reimplement a lot of these optimizations?
评论 #38492244 未加载
rishav_sharan超过 1 年前
&gt; Fast Compilation Onyx&#x27;s compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in 47 milliseconds.<p>Ok, that got my attention. Its refreshing to see a new language which doesn&#x27;t takes 10 seconds to build a Hello world example.<p>Couple of questions;<p>1. The Windows installation is a bit tedious. Any plan to support Scoop for installing Onyx?<p>2. Given that gamedev seems to be a focus, with the raylib integration, how is the performance compared to something like c. Will a comparable onyx program get me to at least 50%+ of the performance of c? I haven&#x27;t used webassembly much so I am curious how this works out.<p>I was just thinking of creating a new project to try out Raylib 5. So your post has perfect timing for me!<p>Best of luck to your language. Looks lovely in the online playground. Now going to set it up on my device
ReleaseCandidat超过 1 年前
&gt; To navigate these limitations I came up with a way for any WebAssembly embedder, like Wasmer, to interact with native system components. ... I added a custom section to the WASM binaries output by Onyx that specifies which native libraries it wants to link against.<p>So the main reasons for using WASM and all of it&#x27;s advantages are lost. It&#x27;s neither sandboxed nor self contained any more, but slower than using &quot;native&quot; compilation and still missing libraries (compared to JVM, CLR, Beam,...). Don&#x27;t get mé wrong, I know about the advantages of WASM for the language implementor (although I&#x27;d use WASM GC), but as a user, but I don&#x27;t know why I should use Onyx.
kettlecorn超过 1 年前
Can Onyx&#x27;s compiler be compiled to Wasm to itself run in the browser?<p>It&#x27;s niche, but I&#x27;ve thought it&#x27;d be cool if there were a mini Wasm-based game building tool in the browser, but that requires a Wasm language with a compiler that can run in the browser.
评论 #38493776 未加载
pyrossh超过 1 年前
Nice name analogous to ruby.<p>From wikipedia,<p>Onyx - A banded variety of chalcedony, a cryptocrystalline form of quartz.<p>Ruby - A clear, deep, red variety of corundum, valued as a precious stone.
评论 #38498142 未加载
pyrossh超过 1 年前
I&#x27;ve been trying to build a programming language targeting only wasm but never seem to get the time to work on it.<p>Like the syntax, mainly the pipe operator |&gt;<p>A few questions,<p>1. Any plans to use binaryen to optimize the wasm output?<p>2. How is memory management handled? Are you going to use wasm-gc?<p>3. How does the C FFI work? Do you convert the WASM types to C types?
bobajeff超过 1 年前
&gt; When linking, I find the libraries on disk, load them, call a function in each dynamic library that returns a list of procedures that can be used when linking. This external linking enables Onyx to use any native C library, from Raylib and OpenGL, to PostgresQL and OpenSSL.<p>This is really cool. I wonder if there is any overhead using native libraries from wasm like this. My intuition says it does similar to node-ffi and JNI but I hope it&#x27;s not as bad.
评论 #38493906 未加载
spuz超过 1 年前
I am getting network errors loading some paths on the onyxlang.io website. That&#x27;s not a good advertisement for Wasmer.
评论 #38497764 未加载
WhereIsTheTruth超过 1 年前
Does it support hotreload?<p>To me that&#x27;s the piece that&#x27;s missing in all these new languages<p>Being able to hot patch code saves you from having to recompile everything and reload the state of your program, saves lot of time<p>I was excited when Zig announced planning it, but it&#x27;s been like 4 years now and they went radio silence unfortunatly
评论 #38498924 未加载
insanitybit超过 1 年前
How did you find the experience of compiling to wasm? Do you build an IR first at all or just ast -&gt; wasm?
评论 #38494434 未加载
adiabatty超过 1 年前
Since the guy who makes this is in the thread and I&#x27;m not the first to say stuff about the website…<p>Seems cool but I was trying to read one of the examples on &lt;<a href="https:&#x2F;&#x2F;onyxlang.io&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;onyxlang.io&#x2F;</a>&gt; and the carousel changed pages, throwing me off.<p>Would you consider not using a(n auto-advancing) carousel with code examples?<p>Not unrelated: &lt;<a href="https:&#x2F;&#x2F;shouldiuseacarousel.com" rel="nofollow noreferrer">https:&#x2F;&#x2F;shouldiuseacarousel.com</a>&gt; (short answer: &quot;no&quot;)
评论 #38495783 未加载
评论 #38495107 未加载
CyberDildonics超过 1 年前
I&#x27;m not sure a specific compilation target that is meant to be as simple and generic as possible makes a new language a good idea.<p>New languages mean you start all over and wipe away decades of tools, knowledge, libraries, development environments, package managers, workflows and now people are in the wild west again. To justify that you have to have some enormous benefits.
ipsum2超过 1 年前
Not to be confused with Onnx, a popular language for machine learning models, that is also commonly used with WebAssembly. Even the logo looks similar.<p><a href="https:&#x2F;&#x2F;onnx.ai&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;onnx.ai&#x2F;</a><p><a href="https:&#x2F;&#x2F;cloudblogs.microsoft.com&#x2F;opensource&#x2F;2021&#x2F;09&#x2F;02&#x2F;onnx-runtime-web-running-your-machine-learning-model-in-browser&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;cloudblogs.microsoft.com&#x2F;opensource&#x2F;2021&#x2F;09&#x2F;02&#x2F;onnx-...</a>
评论 #38492530 未加载
评论 #38494540 未加载
评论 #38494631 未加载
koube超过 1 年前
nit: seamless not seemless.<p>Actually TIL seemless is actually a word but it&#x27;s a synonym for unseemly.
评论 #38491837 未加载
ivanjermakov超过 1 年前
I have irrational anger towards := assignment operator, probably because of Pascal course in high school.<p>Interesting if anyone else have such stories regarding language syntax and features.
评论 #38494133 未加载
评论 #38492879 未加载
评论 #38491939 未加载
评论 #38495363 未加载
评论 #38492834 未加载
评论 #38491830 未加载