Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple scripting language

License

NotificationsYou must be signed in to change notification settings

Jomy10/nootlang

Repository files navigation

A simple scripting language, created specifically forNootBot.

Hello World

// helloWorld.nootnoot!("Hello World")

Description

Nootlang is a simple scripting language mainly developed forNootBot.The interpreter and parser are intentionally kept simple and readable as it is alsodeveloped as a learning project. Anyone interested in making programming languages orparsers and interpreters in general should be able to understand the code rather easily.The interpreter is therefore focussed on readability rather than speed.

Roadmap

  • Types
    • integers
    • strings
    • floats
    • booleans
    • functions
    • anonymous functions
    def myFunc() {}def myOtherFunc(fn) { fn() }myOtherFunc(myFunc)myOtherFunc(|| {})
    • structs
    • interfaces
    • tuples
    • type assertion
  • Functions
    • functions
    • scopes
  • modules
  • Statements
    • if/elsif/else
    • match

Native Function Interface

Native functions (like the ones in thestandard library), are of thefollowing signature:

func(*runtime.Runtime,args []interface{}) (interface{},error)
  • The first argument passed to any function is always the runtime, this containsall the variables and functions available.

  • The second is an array of all the arguments passed to this function

  • The function can return a value as its first return type, or nil if it does notreturn a value

  • If a runtime error occurs during execution, the function should return adescriptive error as its second argument

Contributing

Contributions are always welcome.

  • Additions (e.g. new syntax, etc.) to the language should be discussed first inan issue befoe submitting a pull request
  • Speed improvements to the interpreter, parser or tokenizer will be accepted aslong as they do not compromise on readability. The focus of this project lies inreadability for newcomers.
  • However, if you are passionate about making a fast interpreter for nootlang,this is encouraged. Just make a new folder in this project for the faster interpreterso that they are separated. Here, readability can be compromised for speed (JITcompilation, caching, etc.)
  • Documentation is highly needed at the moment

License

Nootlang is licensed under theMIT license.

Releases

No releases published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp