TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A look at Unison: a revolutionary programming language

296 pointsby lycopodiopsidaover 2 years ago

15 comments

dietr1chover 2 years ago
Looking at the comments it seems that this talk might be a better introduction than just skimming at the landing page.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gCWtkvDQ2ZI">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gCWtkvDQ2ZI</a><p>I watched that in 2020 or so and got amazed at how much a seemingly simple idea could work it&#x27;s way into the core of a language. What I recall is this,<p>The main new idea is turning codebases into a content-addressed store, this needs some new tooling, but makes a couple of interesting things possible,<p>* Having different versions of the &quot;same&quot; function. They are actually different functions anyway, so you can do things like partial library upgrades when there&#x27;s breaking changes. Large migrations like python 2 to 3 wouldn&#x27;t take O(10yr).<p>* Formatting is not a thing anymore. This goes further than just having a formatter as there&#x27;s really no format nor names you can&#x27;t personalize locally without affecting anybody.<p>* Similarly, renaming is free, so you can come up with better names in the future and chanting it just needs a tweak to the canonical name for the function.<p>* Functions are serialiazable, which makes it possible to send them to remote nodes for execution without any concerns about their deus, since a function is now more of a Merkle tree, so if there&#x27;s any difference the client would know and be able to ask for missing dependencies<p>* The tool to manage your function repo might seem like a burden to some, but once you realize that having this as a first class tool that understands the language you can propose safe mass refactoring of code you don&#x27;t own.
评论 #34337264 未加载
评论 #34337392 未加载
评论 #34339026 未加载
评论 #34339457 未加载
lisperover 2 years ago
This looks attractive at first but it has one show-stopping problem AFAICT: if it turns out that a function has a bug, you can&#x27;t fix it by changing the function definition. You have to create a new function <i>and then change every single call site from the old definition to the new one</i>.<p>Maybe there is a solution to this problem, but a cursory review of the language description didn&#x27;t turn one up. It seems like a Really Hard Problem because there is nothing that can structurally distinguish between a new function that is created for its own sake, and a new function that is intended to be a bug-fixed (or otherwise enhanced) version of an old one.<p>Maybe a unison aficionado can enlighten me?
评论 #34336839 未加载
评论 #34336811 未加载
评论 #34336451 未加载
评论 #34337026 未加载
评论 #34336480 未加载
评论 #34337503 未加载
评论 #34346726 未加载
评论 #34338486 未加载
robocatover 2 years ago
I worked using an object oriented database, where all code was stored as the AST as versioned objects in the database. Problems that I remember that might be relevant:<p>1. To “install” code into another instance, you usually exported your code as a massive text file from your dev server as source code, then import the source code as text into your production server. You could do individual functions, but that had a high risk of ending up with a pet with different code than your dev server. Version control was a mess.<p>2. We just ended up putting source code (without comments) directly onto production servers. That happened to turn out well for the client, and turn out badly for the development company (who owned the code).<p>3. Syntax or semantic changes to the language were a bitch when the database version needed an upgrade. Any existing code was migrated, from the old objects to the new objects, which sometimes caused problems.<p>4. Limited IDE. You had to use the IDE that came with the database, and various code transforms, global refactors, or normal development actions were unavailable. The primary other option was to export a complete syntax tree as text, make changes, then re-import (uggggh).<p>5. Debugging was hell.<p>Obviously Unison is a very different beast, but some of the above problems were a result of having the AST be the source of truth: problems which have the potential to apply to Unison too.
评论 #34338771 未加载
dangover 2 years ago
Related:<p><i>The Unison language – a new approach to Distributed programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33638045" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=33638045</a> - Nov 2022 (113 comments)<p><i>Unison Programming Language</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27652677" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=27652677</a> - June 2021 (131 comments)<p><i>Unison: A Content-Addressable Programming Language</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22156370" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22156370</a> - Jan 2020 (12 comments)<p><i>The Unison language</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22009912" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22009912</a> - Jan 2020 (141 comments)<p><i>Unison – A statically-typed purely functional language</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20807997" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20807997</a> - Aug 2019 (25 comments)<p><i>Unison: a next-generation programming platform</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9512955" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9512955</a> - May 2015 (128 comments)
dmytrishover 2 years ago
My experience with Unison so far has been limited to learning the basics and doing a few exercises on Exercism.io (big kudos to whoever added the Unison track there, it&#x27;s a really great way to get your hand dirty with a new language!).<p>Coming from Haskell&#x2F;other functional programming languages background, I have found many things familiar. Unison can be an improvement and an opportunity to do better this time.<p>What I still find lacking:<p>- developer experience and tooling: there&#x27;s no language server (is it even possible for Unison?) or an easy development environment. I found myself confined to the usual vim+tmux+&quot;repl&quot; combo. A VSCode plugin that I tried was pretty basic, even though it showed the structure of code base and libraries nicely. Even Haskell is more pleasant with haskell-language-server these days.<p>- discoverability of library functions: skimming through modules, reading docs, trying to figure out what to use. Type-aware search (like Hoogle) is a great idea, but it does not replace the ergonomics of having context-specific completions. Having dot-namespaces relevant to a specific object (in OOP&#x2F;Go&#x2F;Rust style) makes this so much easier for me.
评论 #34339220 未加载
michaelmiorover 2 years ago
&gt; Unison does away with builds. Completely!<p>&gt; It has a canonical representation for all code,<p>Isn&#x27;t generating that canonical representation the build step?<p>&gt; The important thing is that now, I can actually compile and run this program<p>Now I&#x27;m confused whether there is or isn&#x27;t a build step.
评论 #34335608 未加载
评论 #34334808 未加载
评论 #34334438 未加载
xet7over 2 years ago
&gt; As I write this in early 2023, finally, I think it has reached a level of maturity where it’s actually usable for real work, so I decided to write about my impressions using the language for something non-trivial.<p>For what non-trivial you used Unison for? Are you allowed to write about it?<p>Is that those examples in this Unison introduction article, or something else?
scanrover 2 years ago
It will be interesting to see how it handles transitive dependencies through a supply chain you don’t control. Same issue as “this 3rd party npm package depends on an insecure version of X” but at a function level.
jdouganover 2 years ago
Integrate this with IPFS (or other DHT) and you have a distributed code database with the possibility of massively parallel builds.<p>(Assuming I understand the claims properly)
评论 #34335554 未加载
评论 #34339130 未加载
评论 #34335415 未加载
ultra_nickover 2 years ago
I started designing my own functional dataflow language to simplify distributed programming. It looks like I can stop.<p>Does Unison execute its DAG of functions concurrently by default?
beastman82over 2 years ago
FWIW I&#x27;m acquainted with a few folks on this team and it&#x27;s the biggest concentration of talent I&#x27;ve ever seen.
kwhitefootover 2 years ago
Why do we need a new language to do this?
aetherspawnover 2 years ago
Finally, a programming language that can be used in Tarrey Town.
cratermoonover 2 years ago
&gt; tests that run every single build even when nothing checked by them has changed<p>Oh yes, because we can always be sure that a change in one place will never cause a test in another place to fail.
评论 #34335195 未加载
评论 #34335374 未加载
评论 #34335067 未加载
pmarreckover 2 years ago
Or just use your existing language of choice, but incorporate Nix (which is based on the same idea), or go all-in and use NixOS (or Guix, very honorable mention) to get the same ideas all the way to the bare metal of the hardware (which IMHO is where the reach of this idea belongs, it is that good)<p>For example, there are tools that convert traditional lockfiles to nix flakes.<p>Nix is more intimidating than it actually is. It’s basically JSON with pure functions and some syntactical-sugar shorthands that end up being very nice.<p>“Flakes” are basically lockfiles for Nix. Before Flakes, Nix still used hashed dependencies though. So everything you install with it is more or less guaranteed to also automatically pull in everything it needs to run, without conflicting with the needs of anything else.
评论 #34334530 未加载
评论 #34334322 未加载
评论 #34334459 未加载
评论 #34334596 未加载
评论 #34334545 未加载
评论 #34336556 未加载
评论 #34335470 未加载
评论 #34336943 未加载