Git Product home page Git Product logo

elymas's Introduction

Elymas

Just because I'm not following the true path, doesn't mean I can't get it to work.

Examples

A programming language...

1 dump
# 0000000000000001

... stack based programming language ...

1 2 add dump
# 0000000000000003

... with array support ...

[ 1 2 ] dump
# [
#   0000000000000001
#   0000000000000002
# ]

... did I mention array support ...

2 [ 1 2 ] add dump
[ 0 1 ] [ 1 2 ] add dump
# [
#   0000000000000003
#   0000000000000004
# ]
# [
#   0000000000000001
#   0000000000000003
# ]

... user definable functions ...

{ 2 add } /addTwo deffst
1 addTwo dump
# 0000000000000003

... variables ...

2 ==two
1 two add dump
# 0000000000000003

... function objects ...

{ { 2 add } } /returnAddTwo deffst
returnAddTwo /addTwo deffst
1 addTwo dump
# 0000000000000003

... closures ...

{ 2 ==two { two add } } /returnAddTwo deffst
returnAddTwo /addTwo deffst
1 addTwo dump
# 0000000000000003

... structured data types ...

<
  1 ==one
  2 ==two
> ==struct

struct keys dump
struct .two dump

# [
#   "one"
#   "two"
# ]
# 0000000000000002

... and more.

"Elymas" { "(..)(.*)" regex } |dump loop

# "El"
# "ym"
# "as"

Technical Pecularities

  • no runtime interpreter, executes real assembly
    • same binary both interpretes and compiles
  • freeze arbitrary program states to ELF-binaries
  • self hosted via { "/proc/self/fd/0" include }' "interpreter" sys .freeze
    • yes, this works and generates a stand-alone interpreter/compiler
    • bootstraps from perl
      • no perl left in final binaries
  • macro support
  • names carry information about being constant or constantly having the same type each resolution
    • just-too-late opcode optimization
    • so at least one resolution is guaranteed to have taken place
    • can declare names any time before first usage
  • assembly optimizer realized as a loadable library
    • yes, it does optimize itself while running
  • regex-engine written in the language itself
  • source includes an assembler for 64bit x86

Features

  • non-braindead stack manipulation, e.g. -021 specifies "top element, then third, then second"
  • concatenative language syntax, e.g. data modifyOne modifyTwo modifyThree
  • trivial to build DSLs
  • compact code
    • more readable than APL though
    • unless you don't want it to be
  • acceptable performance (and you can always switch to assembly if necessary)
  • I actually use it for non-trivial projects

Documentation

Please see doc/tutorial.md for an introduction and further documentation.

elymas's People

Contributors

drahflow avatar rohieb avatar

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.