Weekly update on development process (Nov 07, 2023)

Fairpool
3 min readNov 7, 2023

Fairpool is a DEX for personal tokens. Create your own token & receive royalties from trading volume. Increase volume by offering dividends / selling content for your token. Subscribe to our Telegram / Twitter to get notified about updates.

Weekly progress

  • ⚒ Worked on a better way to communicate within a team.
  • ⚒ Worked on our decision-making system.

Unilang

Developers spend a lot of time on communication: refining customer requirements, synchronizing with colleagues, delivering reports to managers. However, communication in a natural language is naturally ambiguous: most words have multiple meanings, so it’s hard to communicate the ideas precisely. This slows down the work & increases the cost of software in the long-term. What if we could avoid misunderstandings by using a formal language where every term has a single, well-defined meaning?

We have discovered a very simple language that allows defining terms in a non-ambiguous way. We hope that this language would improve the communication within our team & within other teams as well. Below we describe the language & the rationale behind it.

Readlang’s greatest advantage is readability. Try reading the following code — see if you can understand it immediately:

// You can write comments with “//” (everything after “//” is skipped by the interpreter)
// You can print things on the screen:
Print “Hello, world!”

// You can define functions by pattern matching:
Greet name = Print (“Hello, ” + name + “!”)

// You can call functions by providing all arguments
Greet “John”

// ------------------
// Everything above was a walk in the park
// Let’s dive into a rabbit hole
// ------------------

// You can define your own natural numbers
IsNaturalNumber Zero = True
IsNaturalNumber (Step x) = IsNat x
IsNaturalNumber other = False
0 = Zero
1 = Step Zero
2 = Step (Step Zero)
3 = Step (Step (Step Zero))
Print (IsNaturalNumber 3) // True
Print (IsNaturalNumber Alice) // False
// Notice that x is a variable (starts with a lowercase letter)
// Notice that Zero is a constant (starts with an uppercase letter)
// Notice that Step is a functional constant (starts with an uppercase letter, requires one argument)

// You can use the “>>” (“pipe”) operator to chain function calls
3 = Zero >> Step >> Step >> Step

// Let’s get more rational
IsRationalNumber x y = IsNaturalNumber x >> And (IsNaturalNumber y) >> And (Not (IsZero y))

// Oops, we forgot to define And and Not
// Well.. whatnot
And True True = True
And x y = False

Not True = False
Not False = True

// Actually, our rational numbers are too positive: we didn’t provide for negative numbers
// No problem - we can redefine them dynamically
// Great solution for those cases where you need to fix some buggy code written by another developer
IsRationalNumber x y = IsIntegerNumber x >> And (IsNaturalNumber y) >> And (Not (IsZero y))

// Define IsIntegerNumber
IsIntegerNumber (Positive x) = IsNaturalNumber x
IsIntegerNumber (Negative x) = IsNaturalNumber x
// This definition allows for two zeros: Positive Zero and Negative Zero
// The actual definition in the standard library fixes this problem

// ------------------
// The rabbit hole is over
// The Wonderland begins
// ------------------

// Let’s calculate!
Add x Zero = x
Add x (Step y) = Add (Step x) y

Trace (Add 2 3)
// Add 2 3
// Add 2 (Step (Step (Step (Zero))))
// Add (Step 2) (Step (Step (Zero)))
// Add (Step (Step 2)) (Step (Zero))
// Add (Step (Step (Step 2))) (Zero)
// (Step (Step (Step 2)))
// (Step (Step (Step (Step (Step (Zero))))))

This is just a sneak peek of what is possible with Unilang. The syntax & evaluation rules are universal — they can be used to implement the type system and define propositions. The propositions would constitute a knowledge base of the company, shared by all employees.

If a specific employee doesn’t agree with a proposition (has another opinion), he/she may provide a proof that this proposition is false (leads to contradiction). If this happens, the proposition is replaced with its negation, and the opinion of the employee becomes automatically accepted within the company.

No more Zoom calls with heated discussions — just write code!

--

--

Fairpool

Fairpool is a DEX for personal tokens. Create your token & receive royalties from trading volume. Increase volume by offering dividends / selling content.