https://github.com/kekyo/nesp
A Lisp-like lightweight functional language on .NET
https://github.com/kekyo/nesp
compiler csharp dotnet functional-language lisp repl
Last synced: about 1 month ago
JSON representation
A Lisp-like lightweight functional language on .NET
- Host: GitHub
- URL: https://github.com/kekyo/nesp
- Owner: kekyo
- License: other
- Created: 2017-07-19T09:54:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-11-25T13:03:22.000Z (over 5 years ago)
- Last Synced: 2025-03-21T23:22:30.078Z (about 1 month ago)
- Topics: compiler, csharp, dotnet, functional-language, lisp, repl
- Language: C#
- Size: 1.62 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.)

[](https://ci.appveyor.com/project/kekyo/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.
* 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
* Copyright (c) 2017 Kouji Matsui
* Under Apache v2 http://www.apache.org/licenses/LICENSE-2.0## History
* 0.5.1 Public open.