All Projects → charly-lang → Charly

charly-lang / Charly

Licence: mit
🐈 The Charly Programming Language | Written by @KCreate

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to Charly

retro12
This repo is retired. See http://forthworks.com:8000/
Stars: ✭ 18 (-90.27%)
Mutual labels:  interpreter, repl
Bic
A C interpreter and API explorer.
Stars: ✭ 719 (+288.65%)
Mutual labels:  interpreter, repl
Rascal
The implementation of the Rascal meta-programming language (including interpreter, type checker, parser generator, compiler and JVM based run-time system)
Stars: ✭ 284 (+53.51%)
Mutual labels:  interpreter, repl
huginn
Programming language with no quirks, so simple every child can master it.
Stars: ✭ 41 (-77.84%)
Mutual labels:  interpreter, repl
Endbasic
BASIC environment with a REPL, a web interface, and RPi support written in Rust
Stars: ✭ 106 (-42.7%)
Mutual labels:  interpreter, repl
malluscript
A simple,gentle,humble scripting language for mallus, based on malayalam memes.
Stars: ✭ 112 (-39.46%)
Mutual labels:  interpreter, repl
Red
Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single 1MB file!
Stars: ✭ 4,725 (+2454.05%)
Mutual labels:  interpreter, repl
endbasic
BASIC environment with a REPL, a web interface, a graphical console, and RPi support written in Rust
Stars: ✭ 220 (+18.92%)
Mutual labels:  interpreter, repl
Goto
Goto is an interpreted programming language written in go.
Stars: ✭ 79 (-57.3%)
Mutual labels:  interpreter, repl
Mappy
A functional programming language. Like LISP but focused around maps rather than lists.
Stars: ✭ 10 (-94.59%)
Mutual labels:  interpreter, repl
lambda
lambda calculus interpreter
Stars: ✭ 23 (-87.57%)
Mutual labels:  interpreter, repl
Gomacro
Interactive Go interpreter and debugger with REPL, Eval, generics and Lisp-like macros
Stars: ✭ 1,784 (+864.32%)
Mutual labels:  interpreter, repl
ol
Otus Lisp (Ol in short) is a purely* functional dialect of Lisp.
Stars: ✭ 157 (-15.14%)
Mutual labels:  interpreter, repl
lambda-dti
Interpreter of the ITGL with dynamic type inference
Stars: ✭ 18 (-90.27%)
Mutual labels:  interpreter, repl
klisp
A Lisp written in about 200 lines of Ink, featuring an interactive literate programming notebook
Stars: ✭ 28 (-84.86%)
Mutual labels:  interpreter, repl
Ok
An open-source interpreter for the K5 programming language.
Stars: ✭ 408 (+120.54%)
Mutual labels:  interpreter, repl
fundot
The Fundot programming language.
Stars: ✭ 15 (-91.89%)
Mutual labels:  interpreter, repl
charm
A [ functional stack ] based language.
Stars: ✭ 26 (-85.95%)
Mutual labels:  interpreter, repl
Mico
Mico ("Monkey" in catalan). Monkey language implementation done with C++. https://interpreterbook.com/
Stars: ✭ 19 (-89.73%)
Mutual labels:  interpreter, repl
Brain
An esoteric programming language compiler on top of LLVM based on Brainfuck
Stars: ✭ 112 (-39.46%)
Mutual labels:  interpreter, repl

Build Status Version License

Charly

Warning: This project is no longer being actively maintained. You can find the new project at KCreate/charly-vm


The Charly programming language

Charly is a dynamic, weakly-typed multi-paradigm programming language. This repository contains a Crystal implementation of the language.

Motivation and Goals

I've always been interested in the development and design of new programming languages. This is my first try at writing an actual language. My primary goal was to learn how to teach a machine what my language looks like and what it should do. Based on the experiences I've made while working on Charly, I now feel comfortable to experiment with lower-level technology such as virtual machines or compilers.

This implementation uses a tree-based execution model, which is (as opposed to a bytecode interpreter) rather trivial to implement. Given that I never took any classes or read any books about this topic, it was the easiest way for me to put up a working language. Charly might well switch to a bytecode-interpreter in the future, but only once I've gathered enough experience to feel comfortable with writing a virtual-machine for it.

If you're interested in writing your own programming language, I've compiled a list of resources you may find useful.

Syntax and language guide

Visit the website for an introduction to the language.

Installation

  1. Install Crystal
  2. Clone this repo with git clone https://github.com/charly-lang/charly
  3. Run install.sh

You will be prompted for your admin password (used to copy to /usr/local/bin).

After that you need to set the CHARLYDIR environment variable. Just add the following line to your .bashrc, .zshrc, etc. Replace the path with the path to the Charly source code (e.g The path to the git repo).

export CHARLYDIR=~/GitHub/charly-lang/charly

You can also build the interpreter via the following command:

$ mkdir bin
$ crystal build src/charly.cr --release -o bin/charly

This will place the executable in the bin folder.

OS Support

I'm developing on macOS 10.12 so it should work without any problems on that. The CI Build runs on Ubuntu 12.04.5 LTS.

CLI options

$ charly -v
Charly 0.3.0 [bb5b857] (15. March 2017)
$ charly -h
Usage: charly [filename] [flags] [arguments]
    -f FLAG, --flag FLAG             Set a flag
    -h, --help                       Print this help message
    -v, --version                    Prints the version number
    --license                        Prints the license

Flags:
    ast                              Display the AST of the userfile
    dotdump                          Dump dot language displaying the AST
    tokens                           Display tokens of the userfile
    lint                             Don't execute after parsing (linting)

53 internal methods are loaded

Using the built-in REPL

$ charly repl
> 2 + 2
4
> "test"
test
> $ * 4
testtesttesttest
> func increment(a) { a + 1 }
Function
> increment(25)
26
> print("hello world")
hello world
null
> .exit

If you need to pass arguments or flags to a REPL session you can do so via the repl command

$ charly repl these are all arguments
> ARGV
[these, are, all, arguments]

License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].