Coder Social home page Coder Social logo

pidhii / ether Goto Github PK

View Code? Open in Web Editor NEW
8.0 0.0 0.0 8.51 MB

Yet another language oriented on functional programming.

License: GNU General Public License v3.0

CMake 2.11% Makefile 0.27% Shell 0.04% C++ 2.62% C 87.87% Yacc 5.34% Lex 1.44% Python 0.29% Vim Script 0.02%
interpreter bytecode-interpreter fp functional-programming ml ether

ether's Introduction

!!! IMPORTANT !!!
Documentation of the language on my wiki is outdated. I hope to update it. But developement is still quite rapid so I dont know if it would make sence.

General:

  • REPL
  • Packet manager (dope)

Features:

  • Pattern matching
  • Closures
  • Variant-types
  • Lightweight record-types
  • Persistent tables ...some more flexible dictionary-like thing
  • Classes ...for the sake of inheritance
    • Named classes
    • Objects of unnamed classes
  • Tuples
  • Persistent vectors
  • Regular expressions
  • Macros
    I want it to be something derived from Lisp.
  • User-defined operators
    • redefinition of builtin operators
    • allow definition of new operators
    • precedence for user-defined operators
  • Named arguments
    Can try to exploit records as reading multiple values is quite efficient with them.
  • Exceptions
  • Modules
  • Coroutines
  • Multiple return-values (like in Lua)
  • Ability to enter REPL at break-points (for debug)
  • Type constrains ...whatever it means.
    Need a tool to check signatures (arity + return-value) of functions.
    Easy to implement via language itself but it should have some dedicated syntax + care about performance.

Syntax:

  • simplyfied syntax for loops
  • match like in Caml
  • "do-natation" for monads?

  • Fuck Python, I'm the queen
  • Smart reference counting
  • Capture unpacked fields if available
  • Unpack structs outside closure (if applicable)
  • Inline small functions at first pass
  • Dynamic optimization
    • inline captures
    • branch prediction?
  • Detect fixed values in loops
  • JIT compilation
  • Propagate type information when possible
    • intrinsic operators
    • constructors
    • functions
      • C functions
      • closures
  • Merge sequential unpacks (if applicable)
  • Smaller instructions
  • Delay lambda constructors (when used conditionaly)

Build and install with CMake.
Debug and Release build types are supported.

To build Release configuration do

  • create directory for temporary files:
    $ mkdir build
  • run CMake to generate build-scripts:
    $ cmake -D CMAKE_BUILD_TYPE=Release \ # we want Release-configuration
            -D CMAKE_INSTALL_PREFIX=<where-to-install> \
            -B build \                    # temporary directory for a build
            -S .                          # path to Ether sources
  • build and install (we are using GNU Make here):
    $ make -C build install
  • additionaly you can run some tests:
    $ make -C build test 
  • now you can add Ether to your system environment:
    $ prefix=<full-path-to-installation-directory>
    $ export PATH=$prefix/bin:path
    $ export PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}$prefix/lib/pkgconfig
    or you can use env.sh to setup environment in current shell:
    $ source env.sh <path-to-installation>

To run Ether in interactive mode just run it straightaway:

$ ether
Ether REPL
version: 0.2.0
build: Release
build flags:  -Wall -Werror -Wextra -Wno-unused -Wno-error=cpp -rdynamic -O3 -DNDEBUG
prefix: /home/pidhii/sandbox/create/ether/Release/install

Enter <C-d> (EOF) to exit
Commands:
  '.'                   to reset input buffer (cancel current expression)
  '.help'               show help and available commands
  '.help <ident>'       show help for given identifier
  '.complete-empty'     display all available identifiers when completing empty word
  '.no-complete-empty'  disable effect of the previous command

>

Note that some syntacticly valid expressions will not work for REPL. It is due to "machanisms" of REPL are different to those applied to script processing.

As you may have noticed, ether syntax is wery similar to ML's one, so generaly you can just set your editor to treat it like OCaml for examle. However there are differences, and some of ether-only expressions tend to appear very often in the code (e.g. if let <pattern>).

Vim

I'm maintaining native syntax configuration only for Vim (not familiar with other editors). See ether-vim for the plugin. You can install with pathogen.

To make Vim recognise ether scripts you can add following line to your .vimrc:

autocmd BufRead,BufNewFile *.eth set filetype=ether syntax=ether

If you use NERDCommenter you can also add:

let g:NERDCustomDelimiters = {
  \ 'ether': { 'left': '--', 'leftAlt': '--[[', 'rightAlt': ']]', 'nested': 1 }
  \ }

This world is cruel.

Just joking =)

ether's People

Contributors

pidhii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ether's Issues

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.