Live data from Hacker News

Unison 1.0

unison-lang.org

71–80 of 98 posts

Re: Unison 1.0

#71

Earlier quoted context omitted.

Hello! Yes I am curious, how does one deal with cycles in the code hash graph? Mutually recursive functions for example?

There's an algorithm for it. The thing that actually gets assigned a hash IS a mutually recursive cycle of functions. Most cycles are size 1 in practice, but some are 2+ like in your question, and that's also fine.

If you could link to where this is implemented I'd be very grateful!

Re: Unison 1.0

#72

Ok I tried it out. So I run ucm.cmd and it tells me: "I created a new codebase for you at C:\Users\myuser" but there is nothing there except a .unison folder. I didn't look too closely at first but maybe this all works by storing the code in the sqlite file inside that folder? Dot folders aren't usually relevant for project files. Because then even after the cli had me create a new project called happy-porcupine whic…

Thanks for this report.

The tooling takes a little getting used to but it’s extremely powerful. Here are a few benefits you’ll see -

UCM keeps a perfect incremental compilation cache as part of its codebase format, so you’re generally never waiting for code to build. When you pull from remote, there’s nothing to build either.

Pure tests are automatically cached rather than being run over and over.

Switching branches is instantaneous and doesn’t require recompiling.

Renaming is instantaneous, doesn’t break downstream usages, and doesn’t generate a huge text diff.

All code (and code diffs) are hyperlinked when rendered, supporting click through to definition.

I don’t know if you saw these getting started guides, they might be helpful -

https://www.unison-lang.org/docs/quickstart/

And then this tour -

https://www.unison-lang.org/docs/tour/

You can come by the Discord (https://unison-lang.org/discord) if you have any questions as you’re getting going! I hope you will give it a shot and sorry for the trouble getting started. There are a lot of new ideas in Unison and it’s been tricky to find the best way to get folks up to speed.

The Unison website and docs are all open source btw -

https://share.unison-lang.org/@unison/website

Re: Unison 1.0

#73

Ok I tried it out. So I run ucm.cmd and it tells me: "I created a new codebase for you at C:\Users\myuser" but there is nothing there except a .unison folder. I didn't look too closely at first but maybe this all works by storing the code in the sqlite file inside that folder? Dot folders aren't usually relevant for project files. Because then even after the cli had me create a new project called happy-porcupine whic…

If it helps, here's a side-by-side comparison guide between Java and Unison. It covers the syntax primarily: https://www.unison-lang.org/compare-lang/unison-for-java-dev...

Re: Unison 1.0

#75

Also, hi, I'm one of the language creators, feel free to ask any questions here!

How do you deal with "branded" types, if you know what I mean. Edit: I mean structurally identical types that are meant to be distinct. As I recall Modula 3 used a BRANDED keyword for this.

aha yeah! good question! We have two different types of type declarations, and each has its own keyword: "structural" and "unique". So you can define two different types as as

structural type Optional a = Some a | None structural type Maybe a = Just a | Nothing

and these two types would get the same hash, and the types and constructors could be used interchangeably. If you used the "unique" type instead:

unique type Optional a = Some a | None uniqte type Maybe a = Just a | Nothing

Then these would be totally separate types with separate constructors, which I believe corresponds to the `BRANDED` keyword in Modula 3.

Originally, if you omitted both and just said:

type Optional a = Some a | None

The default was "structural". We switched that a couple of years ago so that now the default is "unique". We are interestingly uniquely able to do something like this, since we don't store source code, we store the syntax tree, so it doesn't matter which way you specified it before we made the change, we can just change the language and pretty print your source in the new format the next time you need it.

Re: Unison 1.0

#76

Also, hi, I'm one of the language creators, feel free to ask any questions here!

I know how fraught performance/micro-benchmarks are. But do you have any data on how performant it is? Should someone expect it to perform similar to Haskell?

Re: Unison 1.0

#78

Oh, so this is not the bidirectional file synchronization tool huh? Name collisions are inevitable, but unison (the sync tool) has been around and in use since 1998, so this one feels especially egregious.

It's literally a very common English word. There's probably a million things with this name.

Re: Unison 1.0

#79

Earlier quoted context omitted.

There's an algorithm for it. The thing that actually gets assigned a hash IS a mutually recursive cycle of functions. Most cycles are size 1 in practice, but some are 2+ like in your question, and that's also fine.

If you could link to where this is implemented I'd be very grateful!

https://github.com/unisonweb/unison/blob/trunk/unison-hashin...

Re: Unison 1.0

#80
I would love to see some benchmarks of unison somewhere on their website. I find knowing there performance characteristics helps a lot with understanding the use cases for a new language.

Even just a really rough "here our requests per second compared to Django, express.js and asp.net" Would be great to get a rough read on where it sits among other choices for web stuff.

More generally, I do hope this goes well for unison, the ideas being explored are certainly fascinating.

I just hope it one day gets a runtime/target that's more applicable to non web stuff. I find it much easier to justify using a weird language for a little CLI tool then for a large web project.

Post reply on HN