Code Monkey home page Code Monkey logo

nesp's Introduction

Nesp - A Lisp-like lightweight functional language on .NET

(Sorry, this project is deprecated. I'm started my own research project instead it. Currently closed source, but I'll open it near future.)

Nesp

AppVeyor Nesp

What's this?

  • Nesp is a Lisp-like lightweight functional language on .NET
  • Nesp is:
    • Very lightweight language syntax likely Lisp's S-expression.
      • A different topic is Nesp don't have "quote" expression.
      • Nesp expressions are lazy evaluation except literals.
    • Applicable .NET library.
    • Expandable tokens.
    • Designed for easy embedding and useful on REPL.

Nesp (REPL)

  • Still under construction...

Nesp standard type names

  • We can use C# like reserved type names (ex: int, short, string, double ...)
  • Additional reserved type names (guid, datetime, timespan, type, math, enum)

Nesp standard functions

  • Numerical operators (+, -, *, /, %)
  • TOOO: Declare function (define)

Nesp REPL functions

  • TOOO: Folder/file manipulations (ls, cd, mkdir)
  • Clear screen (cls)
  • REPL help (help)
  • REPL exit (exit)

Samples

  • Basic tips:
    • Nesp REPL mode not required brackets (...).

Literals

> 123
123 : byte
> 12345
12345 : short
> 1234567890
1234567890 : int
> 1234567890123456
1234567890123456 : long
> 123.456
123.456 : float
> 123.45678901234567
123.45678901234567 : double
> "abcdef"
"abcdef" : string

Property reference

> datetime.Now
7/21/2017 12:04:43 AM : datetime

Function invoke with no arguments

> guid.NewGuid
bb11b743-f5fe-4d68-bbe3-22e05606b3a5 : guid

Function invoke with arguments

> int.Parse "12345"
12345 : int
> System.String.Format "ABC{0}DEF{1}GHI" 123 456.789
"ABC123DEF456.789GHI" : string

Function invoke with nested invoking function expressions

  • If argument is nested invoking function and it has no arguments, you aren't required brackets.
    • This sample invokes Guid.NewGuid(), but NewGuid has no arguments:
> string.Format "___{0}___" System.Guid.NewGuid
"___7ded117e-c873-48cf-a00b-75c57b8aa317___" : string

Bind result

TODO:

> define fooValue (+ 123 456)
fooValue : int
> fooValue
579 : int

Bind function

TODO:

> define intParseAndAdd (str value) (+ (int.Parse str) value)
intParse : string -> int -> int
> intParse "12345"
12345 : int

License

History

  • 0.5.1 Public open.

nesp's People

Contributors

kekyo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lanicon

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.