high-level, safe, and simple programming language
Go to file
2023-05-23 23:30:12 +02:00
.github/workflows Update rust.yml 2023-04-30 22:31:43 +02:00
build_scripts Delete nu_plugin_mers 2023-04-30 21:38:15 +02:00
docs Create intro.md 2023-05-18 02:06:45 +02:00
examples moved examples to own directory 2023-05-23 20:26:08 +02:00
mers to_runnable treats assignment to a variable as initialization/declaration unless is_ref is true. if the variable doesn't exist yet, it will be created. for custom parser implementations, this means that making all variable assignments ones where is_ref is true will work just fine, but explicit declarations can be done by setting it to false if desired. always leaving it at false will repeatedly shadow the variable, so this isn't recommended although it does work. 2023-05-23 23:30:12 +02:00
mers_libs changed VData system again, renamed src/script to src/lang and added src/c.mers, which is an example something that currently does not work properly due to the VData implementation (and serves as a reminder to fix the issue) 2023-05-14 00:11:36 +02:00
site size/welcome.mers no longer has the executable bit set. 2023-05-18 02:34:01 +02:00
.gitignore changed gitignore 2023-04-30 21:38:37 +02:00
external.css . 2023-05-04 05:51:27 +02:00
index.html . 2023-05-18 02:31:04 +02:00
README.md Update README.md 2023-05-18 01:07:15 +02:00

mers build status

Mers is an experimental programming language inspired by high-level and scripting languages, but with error handling inspired by rust.

Why mers?

mers has...

  • the type-safety of statically typed languages
    • mers will not crash unless you exit() with a nonzero exit code or write flawed assumptions using the builtin .assume*() functions (Rust's unwrap or expect)
  • the flexibility of dynamically typed languages
    • x = if condition() { "my string" } else { 12 } // <- this is valid
  • "correctness" (this is subjective and I'll be happy to discuss some of these decisions with people)
    • there is no null / nil
    • all references are explicit: if you pass a list by value, the original list will never be modified in any way.
    • errors are normal values! (no special treatment)
  • a flexible type system to easily represent these errors and any complex structure including recursive types:
    • nothing: [] (an empty tuple)
    • a string: string
    • two strings: [string string] (a tuple)
    • many strings: [string ...] (a list)
    • Either a string or nothing (Rust's Option<String>): string/[]
    • Either an int or an error: (Rust's Result<isize, String>): int/string (better: int/Err(string))
  • compile-time execution through (explicit) macro syntax

How mers?

Mers is written in rust. If you have cargo, use the build script in build_scripts/ to produce the executable.

Now, create a new text file (or choose one from the examples) and run it: mers <file>.

Docs

intro