Lurker News
We have the monthly "Who is hiring?" and "Freelancer? Seeking freelancer?" threads. But what about people who don't want to work for money and are not looking for people who want to work for money but still want to work together on cool projects?

For free to make the world better or to start a startup.
If you do, please post your project or your skills!

Comments (506) 164 threads

Show all comments

Showing thread 158 of 164

linkdd#
I'm writing a new functional language using Rust as a side project.

The repository is not yet opensource because it's in a very early stage (syntax/grammar not definitive, AST not definitive, ...), but if you'd like to help, feel free to contact me (my email is public on github: https://github.com/linkdd
The key features of the language are:
1. values does not have a single type, instead a type declares what values it has:

  class int(n: number) check
    frac(n) = 0
  end

  42 is int     # true
  42 is number  # true
  42 is string  # false
2. Equations that have one or more solutions yields a boolean (need to implement a SAT solver)

  class even(n: int) check
    thereis k: int, n = 2 * k
  end

  42 is int   # true
  42 is even  # true
  43 is even  # false
3. Expressive type definitions:

  class odd(n: int & !even)

  43 is even  # false
  43 is odd   # true

  class result(r: (:ok | :error, any))

  (:ok, 42) is result         # true
  (:error, "oops") is result  # false
  # NB: `:ok` and `:error` are atoms like in Erlang/Elixir
4. Generics:

  class ok(val: (:ok, T))
  class err(val: (:error, T))
  class result(r: ok | err)

  ok(42) is result          # true
  err("oops") is result  # true
5. Set builder notation:

  let s = { x: int | x > 0 }
  s is set  # true

  let russel_paradox = { x: set | x not in x }
  # impossible:
  #   set class does not exist, but the generic class set does
  #   set can only contains T, therefore:
  #     { x: set | x not in x }
  #   is invalid as well, since set is not an int
6. Map/Filter/Reduce operators:

  let sum_of_even_ints_below_10 = { x: int }
    |map x => x * 2
    |filter x => x < 10
    |reduce[0] acc, x => x + acc
7. First order logic operators:

  (true ==> true) = true
  (true ==> false) = false
  (false ==> true) = true
  (false ==> false) = true

  (true <==> true) = true
  (true <==> false) = false
  (false <==> true) = false
  (false <==> false) = true
8. Rust-like Pattern matching:

  x := 42
  y := match x {
    42 => true
    _ => false
  }
9. Goroutines and streams

  func worker(s: stream) -> :ok
  do
    let val: int
    s >> val
    s << (val * 2)
    :ok  # single point of return, last expression is the return statement
  end

  func main() -> (:ok | :error)
  do
    let s: stream

    run worker(s)

    s << 1
    let val: int
    s >> val

    match val {
      2 => :ok,
      _ => :error
    }
  end
10. For now, it's an interpreted language, but I'd like to compile to LLVM IR instead