Code Monkey home page Code Monkey logo

clarence's Introduction



C L A R E N C E - L A N G




My open source work is supported by the community

Special thanks to:

Botpress
Botpress is an open-source conversational assistant creation platform.
They welcome contributions from anyone, whether you're into machine learning,
want to get started in open-source, or just have an improvement idea.


Clarence is a dynamic, embeddable scripting-language. It's syntax are highly inspired by Clojure. However, it features aweful new modifications on it's vm. With Clarence, you're allowed to write code, that even writes code for you! The entire core (vm, parser, interpreter, bytecode) is pretty small. It was implemented using artesian ECMAscript 16 (JavaScript).

Clarence features a fast dynamic bytecode compilation. Similar to Just in Time compilations. You can use it for scientific computations, embeds of large projects and much much more... It's vm is written in Clarence itselfes so it got self-hosted. That's quite nice, cause while compilation, you are allowed to get some parallel compilations using macros!

Projects that use Clarence


clar-http | A server sample for Clarence

cclarence | A stable C to Clarence compiler WIP

clar-mongoDB | A mongoDB plugin for Clarence

clar-stdlib | The stdlib of Clarence WIP

Your's not there? File an Issue or a PR to add your project in clarence.

Sounds great? So take a look in the samples directory or get even an Installer for Clarence!

Install


As already said, Clarence is implemented in JS so install it's module from NPM:

$ git clone https://github.com/clarence-lang/clarence.git
$ cd clarence
$ npm install clar

Done!

Running programs


You can run your programs like this:

Note: this is an executed example using the samples\simple directory!

cd simple
node run <yourFile.clr>
# or do that:
node run hello.clr

Style


Sample stylish clarence apps:

(ns web.server)

(def http (js/require "http"))

(defn handler [request]
    { :status 200
        :headers { "Content-type" "text/html" }
        :body "Hello, World!" })
        
(defn process [req res handler]
    (let [response (handler req)
          status (get response :status 200)
          headers (get response :headers {"Content-type" "text/html"})
          body (get response :body "")]

        (.writeHead res (status (to-object headers)))
        (.end res (body))))
        
(defn run [handler port]
    (.listen (.createServer http ((fn [req res] (process req res handler)))) (port))
    (println "Server listening at port " port))
    
(run handler 3000)

It's a simple webserver using a http module that is parsed to clarence. It will run on http://localhost:3000


Made by Timo Sarkar

Licensed under MIT

Domo Arigato!

... And happy coding!

clarence's People

Watchers

 avatar

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.