MCPcopy Index your code
hub / github.com/PistonDevelopers/dyon

github.com/PistonDevelopers/dyon @v0.36

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.36 ↗ · + Follow
572 symbols 2,165 edges 47 files 63 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

dyon

A rusty dynamically typed scripting language

Tutorial
Dyon-Interactive
Dyon Snippets
/r/dyon

Dyon script files ends with ".dyon".

To run Dyon script files from command line, type:

cargo install --example dyonrun dyon

Then, to run a script file you type:

dyonrun <file.dyon>

Editor-plugins

Dyon for the Atom Editor
Dyon for the Vim Editor

coding

List of features

Why the name Dyon?

Dyon is a hypothetical particle predicted by several grand unified theories in physics with both electrical and magnetic charge. See wikipedia article for more information.

The name Dyon fits because, just like the particle, there are things that are yet to be discovered about language design. However, this language was not born out of a grand new vision, but is the result of exploring and testing new ideas.

Motivation and goals

Sven Nilsen started this project in early 2016. The idea was to make a simple, but convenient scripting language that integrated well with Rust.

  • During the first week of coding, a way to do lifetime checking on function arguments was discovered
  • A different approach to code organization was explored by adding the ability to dynamically load modules
  • For nice error handling, added option, result and ? operator
  • To test the design of the language, created a demo for interactive coding
  • Mutability check to improve readability
  • Short For loop to improve readability and performance
  • Mathematical loops and unicode symbols to improve readability
  • Go-like coroutines to add multi-thread support
  • 4D vectors with unpack and swizzle to make 2D and 3D programming easier
  • Html hex colors to make copying colors from image editors possible
  • Optional type system to help scaling a project
  • Ad-hoc types for extra type safety
  • Current objects to improve prototyping and tailored environments
  • Macros for easier embedding with Rust
  • Secrets to automatically derive meaning from mathematical loops
  • Closures that can be printed out, use current objects and grab from closure environment
  • Type safety for secrets, easy load/save of Dyon data
  • Link loop for easier and faster code generation and templates
  • In-types for easy cross thread communication

Main goals:

  • Integrate well with Rust
  • Flexible way of organizing code

Performance will be optimized for the cycle:

coding -> parsing -> running -> debugging -> coding

Sub goals:

  • Safety

Non-goals:

  • Rust equivalent performance
  • Replace Rust to build libraries
  • Interfacing with other languages than Rust

License

Licensed under either of * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) * MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

Extension points exported contracts — how you extend this code

PopVariable (Interface)
Implemented by types that can be popped from the runtime stack. [19 implementers]
src/embed.rs
PushVariable (Interface)
Implemented by types that can be pushed to the runtime stack. [20 implementers]
src/embed.rs
ConvertVec4 (Interface)
Implemented by types that can be converted to and from vec4. [7 implementers]
src/embed.rs

Core symbols most depended-on inside this repo

clone
called by 590
src/lib.rs
len
called by 305
src/ast/mod.rs
error
called by 290
src/lib.rs
push
called by 289
src/runtime/mod.rs
into
called by 225
src/vec4.rs
source_range
called by 210
src/ast/mod.rs
pop
called by 165
src/runtime/mod.rs
resolve
called by 165
src/runtime/mod.rs

Shape

Function 322
Method 165
Class 64
Enum 18
Interface 3

Languages

Rust98%
TypeScript1%
Python1%

Modules by API surface

src/dyon_std/mod.rs100 symbols
src/ast/mod.rs65 symbols
src/lib.rs61 symbols
interactive/src/lib.rs56 symbols
src/runtime/mod.rs51 symbols
src/write.rs30 symbols
source/bench_rust/n_body.rs16 symbols
src/link.rs15 symbols
interactive/examples/dyongame.rs15 symbols
src/ty.rs14 symbols
src/runtime/for_n.rs12 symbols
src/dyon_std/data.rs11 symbols

For agents

$ claude mcp add dyon \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page