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.

The Unison language

262 pointsby ocfnashover 5 years ago

33 comments

giancarlostoroover 5 years ago
One thing that takes away from programming languages is not having code samples on the index. I think this lets someone know immediately if it&#x27;s interesting to them or not. Show a sample of code with the console output or a screenshot of an UI from the code. I think Racket had it right ages back. They would show everything from a web server, to other things. This is what major programming languages (with some exceptions) basically do and it gives a developer more information than any amount of marketing speak.<p>That said, I had to dig in the documentation to find code, and it didn&#x27;t seem as obvious cause the syntax is definitely different from what I&#x27;m used to and there&#x27;s weak syntax highlighting.
评论 #22011270 未加载
评论 #22010960 未加载
评论 #22016189 未加载
评论 #22010869 未加载
评论 #22011817 未加载
ivanbakelover 5 years ago
Reading the tour[1], I got the impression of being struck by something not that surprising, but still fundamentally groundbreaking.<p>Beyond just the idea of a global program store (which I hope has space for some virtualenv equivalent), the cleverness of effect handlers as a first-class language feature is very exciting.<p>Once the type system is more mature, this could easily be the next kind of Haskell - a language which redefines modern ideas of good programming.<p>1: <a href="https:&#x2F;&#x2F;www.unisonweb.org&#x2F;docs&#x2F;tour" rel="nofollow">https:&#x2F;&#x2F;www.unisonweb.org&#x2F;docs&#x2F;tour</a>
评论 #22010927 未加载
评论 #22010324 未加载
rzwitserlootover 5 years ago
Kudos to them for not using the buzzword, but if you believe in the notion that &#x27;blockchain is just a fancy buzzword that gives developers the ability to get managers to agree to larger budgets to clean up tech debt&#x27;, this is.. blockchain programming.<p>One problem I did find: Somewhat deeper into the tour, the tour makes the claim:<p>&gt; a Unison codebase can be versioned and synchronized with Git or any similar tool and will never generate a conflict in those tools.<p>This is pratically speaking of course not true: If you have some unison codebase, whilst under the hood it&#x27;s all hashes, that doesn&#x27;t change the simple fact that if 2 people both check out the exact same code, and then both people make a change to how the software operates, where that change is conflicting (say, I make the green &#x27;OK&#x27; button now red, and you make it blue), you.. have a conflict. That is a fundamental property of this interaction; no language bells and whistles can ever change this fact.<p>So, what does happen in unison? Is it &#x27;last committer&#x27; wins? That&#x27;d be a bit problematic. A conflict in your version control system, _IF_ it is representative of the fact that there was an actual conflict (as above with the button and the conflicting colours), is a good thing, not a bad thing.
评论 #22010393 未加载
评论 #22010384 未加载
评论 #22010741 未加载
nadamover 5 years ago
I find the content-addressed, name-independent, immutable (kind of blockchainy) approach to source code very interesting. On the other hand this seems to be rather orthogonal to other (semantic) aspects of the language.<p>I wonder what would happen if we would change one thing at a time to test the idea: create something like unison based on an existing popular programming language. (python, javascript, java, etc...) All the syntax handling, building and version control would be done the unison way, but the interpreter would be the same as today in that popular language. The benefit would be that a lot of existing code could be transferred into the initial &#x27;blockchain&#x27;, with all the current dependency hell being solved from day one. I did not think this through deeply though... Maybe some aspects of existing languages prevent them to be handled the &#x27;unison way&#x27;?
评论 #22011058 未加载
评论 #22012284 未加载
评论 #22017505 未加载
emmanueloga_over 5 years ago
&quot;Unison: a new distributed programming language&quot; by Paul Chiusano [1]<p>1: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gCWtkvDQ2ZI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gCWtkvDQ2ZI</a>
评论 #22010525 未加载
alipangover 5 years ago
Algebraic effect handlers no doubt seem to be the future of getting side-effects under control in programming languages, much like in the way of what immutability has done for data.<p>My (admittedly little) experience with Unison though is that it&#x27;s far from ready for the spotlight however. Much of the docs 404, and joining their discord mostly resulted in the advice to wait for future releases.<p>I wish Microsoft would invest in something like the koka language <a href="https:&#x2F;&#x2F;github.com&#x2F;koka-lang&#x2F;koka" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;koka-lang&#x2F;koka</a>. Perhaps the idea of content-addressable &#x2F; immutable code could find a place too, but I think it&#x27;s less critical.
评论 #22010935 未加载
评论 #22010378 未加载
评论 #22010460 未加载
agbellover 5 years ago
I have learned a lot from the creators Paul and Runar in that past. Their book on FP is legendary in some circles. Unison seems like a super ambitious undertaking, but I wouldn&#x27;t bet against this team.
reggiebandover 5 years ago
I recently came across Unison through YouTube recommending me a series of videos from the &quot;Strange Loop&quot; channel [1]. The fundamental idea of uniquely addressing functions based on a hash of their AST is mind-blowing to me. Immediately my mind started to consider many of the possible paths such an idea could lead down, many of which are clearly tickling the minds of many of the commenters in this thread.<p>My first thought was the same insight from von Neumann architectures: code is data. So I thought of package repositories with URLs corresponding to hashes of function definitions. <a href="http:&#x2F;&#x2F;unison.repo&#x2F;b89eaac7e61417341b710b727768294d0e6a277b" rel="nofollow">http:&#x2F;&#x2F;unison.repo&#x2F;b89eaac7e61417341b710b727768294d0e6a277b</a> could represent a specific function. A process&#x2F;server could spin up completely dumb other than bootstrapped with the language and an ability to download necessary functions. You could seed it with a hash url pointer to the root algorithm to employ and a hash url to the data to run against and it could download all of it&#x27;s dependencies then run. I imagine once such a repo was up and running you could do something like a co-routine like call and that entire process just happens in the background either on a separate thread or even scheduled to an entirely different machine in a cluster. You could then memoize that process such that the result of running repo-hash-url against data-hash-url is cached.<p>e.g. I have <a href="http:&#x2F;&#x2F;unison.myorg.com&#x2F;func&#x2F;b89eaac" rel="nofollow">http:&#x2F;&#x2F;unison.myorg.com&#x2F;func&#x2F;b89eaac</a> run against <a href="http:&#x2F;&#x2F;unison.myorg.com&#x2F;data&#x2F;c89889" rel="nofollow">http:&#x2F;&#x2F;unison.myorg.com&#x2F;data&#x2F;c89889</a> and store the result at <a href="http:&#x2F;&#x2F;unison.myorg.com&#x2F;cache&#x2F;b89eaac&#x2F;c89889" rel="nofollow">http:&#x2F;&#x2F;unison.myorg.com&#x2F;cache&#x2F;b89eaac&#x2F;c89889</a><p>1.<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gCWtkvDQ2ZI" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=gCWtkvDQ2ZI</a>
DerSaidinover 5 years ago
This is cool.<p>I&#x27;ve wanted to see a Merkle tree based AST for faster incremental compilation (and incremental static analysis).<p>I wonder if the source manager interface makes this easier to use than editing source files?<p>AST can still be the source of truth. To edit need to generate source text from AST, edit as text, parse to AST, save.<p>In other words, I think most of the benefits of this can live behind the scenes for other languages.
评论 #22012061 未加载
jganetskover 5 years ago
&quot;As a result, a Unison codebase can be versioned and synchronized with Git or any similar tool and will never generate a conflict in those tools&quot;<p>Conflicts are a feature, not a bug. If two developers are making divergent changes in the same piece of code, I suppose Unison would just let the divergence happen, essentially forking the code. I don&#x27;t think forking code is the right default.
sktrdieover 5 years ago
I like the idea of syntax-tree rather than filesystem directories (if that&#x27;s the main difference).<p>Seems like this could be implemented in other languages though, and don&#x27;t really understand why we need yet another new language.<p>For instance, can I not build my JavaScript code in similar ways: I would need a compiler that stores things in trees rather than dirs.
评论 #22016721 未加载
m712over 5 years ago
No mention of Smalltalk in the comments? The &quot;codebase&quot; that is managed by ucm sounds very similar to Smalltalk images. I am personally delighted about this.
losvedirover 5 years ago
Very cool. Glad to see someone tackling the idea I first saw brought up by Joe Armstrong[0]. When I read his post it made so much sense, I was hoping I&#x27;d get to see someone try it.<p>[0] <a href="https:&#x2F;&#x2F;joearms.github.io&#x2F;published&#x2F;2015-03-12-The_web_of_names.html" rel="nofollow">https:&#x2F;&#x2F;joearms.github.io&#x2F;published&#x2F;2015-03-12-The_web_of_na...</a>
评论 #22023488 未加载
cpreciosoover 5 years ago
Content-addressed, immutable code? Reminds me of <a href="https:&#x2F;&#x2F;thedailywtf.com&#x2F;articles&#x2F;the-inner-json-effect" rel="nofollow">https:&#x2F;&#x2F;thedailywtf.com&#x2F;articles&#x2F;the-inner-json-effect</a>
jganetskover 5 years ago
At first, this sounds like a great idea. On second thought, I have two major categories of concerns:<p>1) If I fix a bug in a function, (thus creating a new version of an existing function) how do I propagate that fix to all that code that transitively depends on the buggy version? Doesn&#x27;t that mean I need to create new versions of all the downstream dependencies? Doesn&#x27;t that defeat separate compilation? Does this scale?<p>2) Does this closely couple interface and implementation? Is it a hash of an implementation, or a hash of an interface? Is it possible to depend only on an interface, and not on an implementation?
评论 #22017048 未加载
kowolkianover 5 years ago
Hell yea, we can finally move forward with editors now. No more saving files with syntax errors. I imagine you could move a lot of paredit functionality into an editor like this, or have excellent voice editing.
miklover 5 years ago
&gt; A friendly programming language from the future.<p>I loathe marketing BS like this. No, you’re not from the future, you pretentious twats.<p>If you have a good idea, let it stand on its own merit, don’t dress it up with manipulative language.
pcr910303over 5 years ago
A TLDR for the tour[0] based on my understanding (please fix me if I’m wrong):<p>Unison is a functional language that treats a codebase as an content addressable database[1] where every ‘content’ is an definition. In Unison, the ‘codebase’ is a somewhat abstract concept (unlike other languages where a codebase is a set of files) where you can inject definitions, somewhat similar to a Lisp image.<p>One can think of a program as a graph where every node is a definition and a definition’s content can refer to other definitions. Unison content-addresses each node and aliases the address to a human-readable name.<p>This means you can replace a name with another definition, and since Unison knows the node a human-readable name is aliased to, you can exactly find every name’s use and replace them to another node. In practice I think this means very easy refactoring unlike today’s programming languages where it’s hard to find every use of an identifier.<p>I’m not sure how this can benefit in practical ways, but the concept itself is pretty interesting to see. I would like to see a better way to share a Unison codebase though, as it currently is only shareable in a format that resembles a .git folder (as git also is another CAS).<p>[0]: <a href="https:&#x2F;&#x2F;www.unisonweb.org&#x2F;docs&#x2F;tour" rel="nofollow">https:&#x2F;&#x2F;www.unisonweb.org&#x2F;docs&#x2F;tour</a><p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Content-addressable_storage" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Content-addressable_storage</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;unisonweb&#x2F;quickstart" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;unisonweb&#x2F;quickstart</a><p>PS: The website is very well made, but I would like to comment that there should be two buttons on the top front page, the tour and installation, as I think most people want to have a glimpse of the PL before installing. I, at least was puzzled because I thought the button was a link to an introduction of the language.
UglyGeniusover 5 years ago
Wondering if Unison was designed as (or ever planned to become) a general-purpose language or it something more domain-specific, e.g. distributed computations.
UIZealotover 5 years ago
This is seriously impressive. I&#x27;ve always felt that some kind of database system is needed for code in which you store each function individually. Unison not only has that, it goes one step further to identify a function by its hash. I can&#x27;t wait to see what the world of programming can become along this direction.
blamestrossover 5 years ago
Append only is nice, but I would think a &quot;Garbage Collect&quot; would be useful. Remove all the code not attached to the import tree anymore. Otherwise you will just keep collecting junk forever Honestly git has the problem too, but I expect orphaned&#x2F;dead code will happen a lot more with this approach.
评论 #22011523 未加载
评论 #22017563 未加载
olodusover 5 years ago
Was thinking of writing this years Advent of Code in Unison but changed my mind because of its very young age and switched to Zig instead. But I&#x27;ll very much consider it for next year. I really think some of its ideas are, if anything else super cool and worth learning and thinking about.
thethimbleover 5 years ago
Does anyone know how concurrency is handled on Unison? I couldn&#x27;t find any references in the docs.
评论 #22014738 未加载
war1025over 5 years ago
Maybe I&#x27;m missing something, but this seems like it would get unwieldy very quickly for anything more serious than toy examples.<p>Even the toy examples I&#x27;m having trouble following along with.<p>The benefit of code-as-text is that you can navigate the text without knowing what you are looking for.<p>This seems to take the opposite approach of making it very easy to look things up <i>assuming you know ahead of time what you are looking for</i>.<p>That is something that a good usage of grep or some more sophisticated IDE integration will already take care of for you.<p>The only thing I could see this being potentially useful for is &quot;notebook&quot; style computation, where you are really only using the language to do things like structured math calculations.<p>What am I missing here?
评论 #22015869 未加载
edover 5 years ago
For a good introduction, watch this talk at 1.5x speed from 2:50 to 5:40<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;gCWtkvDQ2ZI?t=170" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;gCWtkvDQ2ZI?t=170</a>
Avi-D-coderover 5 years ago
I really like the idea, I like the language, but the world will not be rewritten in Unison. A web assembly FFI story is needed for Unison to succeed.
评论 #22010548 未加载
dangover 5 years ago
Related from 2015: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9708405" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9708405</a><p>A larger thread, also from then: <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>
frank2over 5 years ago
Is the Unison codebase manager written in Unison?<p>What other user-facing open-source softwares have been written in Unison?<p>Which of those softwares has been used for months or years by at least one person?
augustkover 5 years ago
I found this rather incomprehensible.
jedimastertover 5 years ago
Maybe I&#x27;ve been out of the game or something. But I don&#x27;t think saying everything is &quot;content-addressed&quot; can land as such of a big mic-drop moment when I&#x27;ve never heard the term or the concept in my life and the front page does absolutely nothing to explain it beyond that.<p>------ EDIT: My tone here is a little more antagonistic that I meant (proofread kids, don&#x27;t just check for spelling and publish) but my first impression was a kind of &quot;buzzword-y&quot; vibe. I&#x27;ve looked a bit more and the authors seem genuinely passionate about shaking things up and trying something completely different, which I can respect. I&#x27;ll leave it up as is because I still think my issue are legitimate, but the tone is a little off and I apologize. ------<p>Let&#x27;s take my discovery path so far as an example:<p>&gt; Functional language: cool cool. I know what that is. Immutable: also cool. Content-addressable: no clue. Saying it&#x27;ll simplify code bases and eliminate dependency and &quot;no builds&quot; is supposed to sound amazing, but it really doesn&#x27;t land when I have no clue what the premise is.<p>&gt; Alright, that&#x27;s it for the front page. No code examples, nothing linking the currently known to this new paradigm-shifting stuff. K. Let&#x27;s try the docs.<p>&gt; The Welcome is the state of the project without saying anything about the language itself. Roadmap isn&#x27;t gonna help Quickstart! Let&#x27;s look there.<p>This amount of effort for discovery isn&#x27;t very helpful for me. I found a selection of talks elsewhere on the site. One of them is labeled &quot;This is a longer (40 min) introduction to the core ideas of Unison and probably the best talk to start with.&quot; That might be a nice link for the front page.<p>I unfortunately don&#x27;t have anymore time to look at this this morning, but the first 5 or so minutes of the talk say waaaaaaaaay more than the first however long I spent. Honestly, I think all of that information (code examples, linking core ideas to what we already know, basis of comparison) could be on the front page.<p>The tl:dr I can glean from it is:<p>It&#x27;s kinda like Haskell, but every definition is turned into AST and put in a hash table. Any references are secretly references to the table, so changing a definition is making a new hash and changing the reference, and renaming is changing the reference to name table.<p>Also, everything is append instead of rewrite, which makes all kinds of stuff cleaner, like versioning and refactoring.<p>Pretty neat idea, I just don&#x27;t really like how long it took me to come to that knowledge. I don&#x27;t know how well it would scale or be usable in a real world scenario, but I also have never used Haskell or any functional language in a &quot;real world&quot; scenario so I&#x27;m not the best one to ask.
评论 #22010812 未加载
评论 #22011014 未加载
Vlad_Zamforover 5 years ago
&gt;&gt;code is content-addressed and immutable.<p>No, as I keep insistently repeating: Code is content-immutable and addressed.<p>Also, Urbit is a lie, Surface detail is true and you are a lie and your code is retarted.
评论 #22010737 未加载
stef-13013over 5 years ago
The language of the month... (Can&#x27;t wait february)
评论 #22011111 未加载
forgotmypwd123over 5 years ago
The name is already pretty taken....<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unison_(disambiguation)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Unison_(disambiguation)</a>
评论 #22010573 未加载