GithubHelp home page GithubHelp logo

cloe-lang / cloe Goto Github PK

View Code? Open in Web Editor NEW
406.0 16.0 10.0 2.66 MB

Cloe programming language

Home Page: https://cloe-lang.org

License: MIT License

Ruby 0.57% Go 99.43%
language functional lazy concurrent parallel asynchronous reactive

cloe's Introduction

Cloe

GitHub Action Coveralls Go Report Card License

logo

Cloe is the timeless functional programming language. It aims to be simple and practical.

Features

  • Functional programming
  • Immutable data
  • Lazy evaluation
  • Implicit parallelism, concurrency, and reactivity

Installation

go get -u github.com/cloe-lang/cloe/...

Go 1.8+ is required.

Documentation

Here.

Examples

Hello, world!

(print "Hello, world!")

HTTP server

(import "http")

(def (handler request)
  ((@ request "respond") "Hello, world!"))

(let requests (http.getRequests ":8080"))

..(map handler requests)

See examples directory for more.

License

MIT

cloe's People

Contributors

dependabot[bot] avatar raviqqe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloe's Issues

Match expression

Pattern match as macros. No design of it so far. It would look like ones in other languages like Haskell and OCaml.

(let x (match matchedValue
    PATTERN1 expression1
    PATTERN2 expression2))

Mascot

We need a kawaii mascot. OCaml Haskell?

Renew ordered interface

Rename ordered interface as comparable and create a totally new ordered interface and implement it for string, number, and list types.

interface ordered {
    ordered() // Just mark as an ordered type.
}

regex library

Should support regex library. We may utilize Go's regexp library or some third-party's.

HTTP library

HTTP library support in the language. One naive design consists of 2 basic functions. One creates HTTP requests as an infinite list and the other one sends responses. This can have more priority than the socket library.

Kahn Process Networks

The way the "Time is space" principle is documented (programs as functions from a stream of inputs to a stream of outputs) makes it spectacularly similar to the Kahn Process Networks model of computation and programming.

Several programming languages for "reactive programming" has been inspired by Kahn Networks, in particular Lustre and Lucid Synchrone. There have also been work on efficient runtime for this form of parallelism, based on efficient implementations of concurrent FIFO queues.

I think it would be interesting for the authors of Tisp looking at these languages to see if there are ideas to take inspiration from.

Macro system

We may not support reader macros.

(macro (unless cond then else) `(if ~cond ~else ~then))

(macro (foo) `123)
(write (+ (foo) bar))

Error handling in Thunk.Eval()

Handle Errors automatically in Thunk.Eval().
Thunk.EvalOrReturnError() may be needed for manual error handling.
We may need to store function names in vm.FunctionType and vm.ClosureType to trace function calls.

Create typeOf function

(typeOf 123) ; => "number"
(typeOf "foo") ; => "string"
(typeOf []) ; => "list"
(typeOf {}) ; => "dict"
(typeOf true) ; => "bool"
(typeOf nil) ; => "nil"
(typeOf someError) ; => "error"

Optional injection of parallelism

Support par primitive function like Glasgow Parallel Haskell. It enables us to increase parallelisms of programs and make impure functions run asynchronously.

Create stdlib package

Create stdlib package for standard library of Tisp.
Some functions in it would be builtins.

Module system

import as just an another special form.

(import "directory/module_name") ; statically used by compiler
(write (module_name.calcAnswer 42))

Create OutputType

OutputType is used only internally to represent outputs from impure functions. Every output function should return OutputType. They are ignored by top-level calls of Thunk.Eval() and seq primitive function.

Comparison operators

<, >, =, <=, >= for Number, String, and List types. = has been implemented already.

Indexing as function calls

Like NewLisp implementing vm.callable for vm.ListType and vm.DictionaryType.

(= ([1 2 3] 1) 2)
(= ([1 2 3] 0 1) [1 2])

(= ({"foo" 123} "foo") 123) 

Str function

Implement str function which converts values of built-in types into their string representations.
And use it in write function.

rally function

rally function takes values and returns a list containing them but they are sorted by times when they are evaluated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.