Unison - A new approach to Distributed computing, Storing Code, etc.

  • Thread starter elcaro
  • Start date
  • #1
elcaro
128
28
TL;DR Summary
Some years ago I posted a message about the idea of storing source code ino a (relational) database in its semantic form (AST-Abstract Synta Tree), instead of text-files. I can't find that post anymore. But here is a new post about this topic, and about a recent implementation about this idea in the form of the Unison programming language and development environment.
Most progrmming languages and programming environments work at the basis of a textual representation of the code, and all tools to built the executables or libraries are based on acessing text files, including the built tools, version control systems and compilers and such. There are not much noteworthy exceptions to this, except perhaps SmallTalk, which nowadays is not used very often.
To change from text-based storing and processing of source code to a storage format that stores the semantic form of the code (in the form of the Abstract Syntax Tree) is therefore a major paradigm shift.

There are both advantages and disadvantages to this:
pro:
The tools for compiling/generating code have already knowledge about all the dependencies of the code. After submitting code to the editor (UCM - Unison Codebase Manager) the AST of the code block is produced and from that a hashvalue (SHA512) is computed and stored. Different code will generate different hashes and hash collisions is almost impossible. All kind of code management, like refactoring, renaming, are much easier to perform, and don't have the disadvantage that regular text-base tools have of leaving the code in an invalid intermediate state. Actions like renaming variables or functions are in fact a no-op, which doesn't break the code nor involves recompiling or rebuilding the code. Distributing the code to other systems is also very easy, if the system already runs Unison, it would just involve sending the hashvalue. If the hashvalue already exists on that platform, it can handle (execute) the code, if not, it can ask for the code to be handed over in byteformat, and all dependencies will automatically be handled.

con:
This new format for storing and developing code is a huge break with existing (text-based) code development, and will require time before it becomes adapated widespread. Existing code bases can (as of yet) not be transformed to Unison, but maybe in the future tools will be developed to migrate from existing platforms to Unison. Existing tools for building/compiling software will not work with Unison (but Unison provides a rich set of tools for that kind of work, which potentially are even more capable as existing tools for program development).

As an introduction to Unison, here are some links to video conversations about Unison, and links to the main website.
Rethinking Distributed Programming with Unison Lang (with Rúnar Bjarnason)
Rúnar Bjarnason - Unison
"Unison: a new distributed programming language" by Paul Chiusano
Rúnar Bjarnason, "Unison: A Friendly Programming Language from the Future"

Official website of Unison lang:
Unison-lang website
 
Technology news on Phys.org
  • #2
It looks like Unison is yet another language, one that believes it is better than all the others. Pardon the cynicism, but I have seen this happen many times before.

Come the revolution, things will be different, not better, just different.
 
  • Like
Likes Vanadium 50, PeterDonis and phinds
  • #3
elcaro said:
TL;DR Summary: Some years ago I posted a message about the idea of storing source code ino a (relational) database in its semantic form (AST-Abstract Synta Tree), instead of text-files. I can't find that post anymore. ...

Would that be all of two years ago ? And rather easy to find ...

:rolleyes:

##\ ##
 
  • Like
  • Haha
Likes pbuk, Vanadium 50 and elcaro
  • #4
Baluncore said:
It looks like Unison is yet another language, one that believes it is better than all the others. Pardon the cynicism, but I have seen this happen many times before.

Come the revolution, things will be different, not better, just different.
It might be, we don't know. There are many cases in which mass adaptation of a breaking technology didn't happen, but sometimes it does happen. What I guess has to happen is that existing development platforms have a path to migrate to Unison, else they will not switch to using Unison. That is why older technologies are still around (FORTRAN, COBOL)....
 
  • #5
BvU said:
Would that be all of two years ago ? And rather easy to find ...

:rolleyes:

##\ ##
I guess you are better as me in finding old posts.... Thx!!
 
  • #7
elcaro said:
TL;DR Summary: storing source code ino a (relational) database in its semantic form (AST-Abstract Synta Tree), instead of text-files. I can't find that post anymore.
Is this secretly ironic?
Baluncore said:
It looks like Unison is yet another language, one that believes it is better than all the others. Pardon the cynicism, but I have seen this happen many times before.
FORTRAN was.

Seriously.

Pre-FORTRAN, your choices were assembly and assembly. FORTRAN was the first commercial higher-level language in wide use. It made pretty much everything easier.

Follow-ons were better in one thing or another (at best - some were universally worse or different to be different) but FORTRAN was a language that improved everything. It basically killed assembly-language programming except for special cases, e.g. operating system noot loaders.

FORTRAN was a huge step. All subsequent steps have been smaller.
 
  • Like
  • Love
Likes BvU and dlgoff
  • #8
Vanadium 50 said:
Is this secretly ironic?

FORTRAN was.

Seriously.

Pre-FORTRAN, your choices were assembly and assembly. FORTRAN was the first commercial higher-level language in wide use. It made pretty much everything easier.

Follow-ons were better in one thing or another (at best - some were universally worse or different to be different) but FORTRAN was a language that improved everything. It basically killed assembly-language programming except for special cases, e.g. operating system noot loaders.

FORTRAN was a huge step. All subsequent steps have been smaller.
Correct. The invention of the FORTRAN programming language and similar programming languages (COBOL, ALGOL) was a huge step forward.

But are better programming languages / programming environments, like the one Unison hopes to offer, which can offer another huge step forward possible?

Unison does not just offer a new programming language - there are many other programming languages that offer advantages for programmers (like Rust, Zig, etc.) but none of them are too breaking - but offers a new way of storing program information. Unlike most other programming languages (with the exception perhaps of SmallTalk) which store and process program infiormation in the form of text files, Unison stores the Abstract Syntax Tree in a database, and all development tools (built tools and version control tools) work with that format.
 

What is Unison and how does it differ from traditional distributed computing models?

Unison is a new approach to distributed computing that focuses on a content-addressable codebase, meaning every piece of code, including functions and libraries, is identified by its content rather than its name or location. This contrasts with traditional models where code is often versioned and distributed through URLs or package names, leading to issues like dependency hell and version conflicts. Unison's model ensures that the exact version of the code is always used, reducing inconsistencies and errors in distributed systems.

How does Unison handle code storage and retrieval?

In Unison, code is stored in a decentralized manner using a content-addressable storage system. Each piece of code, when written, is hashed, and this hash acts as a unique identifier for the code across all machines in the network. Retrieval of code is done by referencing these hashes, ensuring that the exact block of code is executed, promoting immutability and reliability in distributed applications.

What are the benefits of using Unison for distributed computing?

Unison offers several benefits for distributed computing: immutability, scalability, and improved collaboration. The immutability comes from its content-addressable nature, ensuring that once code is written, it cannot be changed, only new versions can be created. Scalability is achieved through its efficient code distribution mechanism, which allows systems to scale without the overhead of managing multiple versions of libraries and dependencies. Lastly, it enhances collaboration by ensuring that every developer is working with the exact same codebase, eliminating "works on my machine" issues.

Can Unison be integrated with existing programming languages and environments?

Yes, Unison is designed to be interoperable with existing programming languages and environments. It can interface with other languages through foreign function interfaces (FFIs), allowing code written in languages like Python, Java, or C++ to call or be called by Unison code. This makes it flexible and adaptable to existing software ecosystems while providing the benefits of its unique approach to code management and distribution.

What are the potential challenges or limitations of adopting Unison in a large organization?

Adopting Unison in a large organization can present several challenges. The primary challenge is the paradigm shift in how code is managed and distributed, which may require significant changes in development workflows and infrastructure. There is also a learning curve associated with understanding and utilizing a content-addressable system. Additionally, as a relatively new technology, there may be fewer resources, tools, and community support compared to more established technologies, which could slow down adoption and troubleshooting processes.

Similar threads

  • Programming and Computer Science
2
Replies
65
Views
2K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
29
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • STEM Academic Advising
Replies
13
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
7K
Back
Top