All Projects → mistersourcerer → ruspea

mistersourcerer / ruspea

Licence: MIT license
A Lisp to be used as a Ruby Library (written in Ruby)

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ruspea

foolang
A toy programming language.
Stars: ✭ 33 (+65%)
Mutual labels:  toy-language, toy-project
Tachyon
Experimental Programming Language Coded in Python!
Stars: ✭ 69 (+245%)
Mutual labels:  toy-language
gitchain
Blockchain concept implemented with git
Stars: ✭ 22 (+10%)
Mutual labels:  toy-project
lplzoo
Fine-grain implementations of common lambda calculi in Haskell, tested with QuickCheck
Stars: ✭ 32 (+60%)
Mutual labels:  language-design
bebe
My own LISP dialect, crafted with love.
Stars: ✭ 15 (-25%)
Mutual labels:  lisp-dialect
Proposals
Tracking ECMAScript Proposals
Stars: ✭ 14,444 (+72120%)
Mutual labels:  language-design
wordle-kt
Wordle game clone made with Kotlin & Compose
Stars: ✭ 33 (+65%)
Mutual labels:  toy-project
js-study-lv1
단국대학교 자바스크립트 스터디 레벨 1 과정을 위한 저장소
Stars: ✭ 18 (-10%)
Mutual labels:  toy-project
Compiler-written-in-Haskell
A Turing complete language 😉
Stars: ✭ 31 (+55%)
Mutual labels:  toy-language
metameta
Metameta is meta core and meta-class programming framework.
Stars: ✭ 39 (+95%)
Mutual labels:  language-design
lip
An embeddable LISP in C99
Stars: ✭ 16 (-20%)
Mutual labels:  language-design
rubylisp
A Lisp dialect of Ruby
Stars: ✭ 20 (+0%)
Mutual labels:  lisp-dialect
compiler-course-unipi
Lab of the course Languages, Compilers and Interpreters (Cod. 653AA) @ UNIPI
Stars: ✭ 18 (-10%)
Mutual labels:  language-design
basil
Fast and flexible language exploring partial evaluation, context-sensitive parsing, and metaprogramming. Compiles JIT or AOT to native code.
Stars: ✭ 93 (+365%)
Mutual labels:  lisp-dialect
Swisp
A simple Scheme (Lisp dialect) interpreter written in Swift.
Stars: ✭ 45 (+125%)
Mutual labels:  lisp-dialect
karta
Experiments with map generation using Voronoi diagrams
Stars: ✭ 87 (+335%)
Mutual labels:  toy-project
Csharplang
The official repo for the design of the C# programming language
Stars: ✭ 8,132 (+40560%)
Mutual labels:  language-design
nearley-playground
⛹ Write Grammars for the Nearley Parser!
Stars: ✭ 76 (+280%)
Mutual labels:  language-design
BuBBLE
A DSL/LISP dialect written in Haskell
Stars: ✭ 20 (+0%)
Mutual labels:  lisp-dialect
f-flat node
F♭ (pronounced F-flat) is a toy language.
Stars: ✭ 22 (+10%)
Mutual labels:  toy-language

Ruspea

A Lisp dialect written in Ruby (and on itself) meant to be used as a standard Ruby gem.

So if anyone asks:

What is this Ruspea thing on the Gemfile?

You can go:

Nah. Just a gem.

Then you can sneak in code like this in your project

(def %fib
  (fn [n]
    (cond
      ((= n 0) n)
      ((= n 1) n)
      (true
        (+
          (%fib (- n 1))
          (%fib (- n 2)))))))

And execute it from Ruby like:

Ruspea::Code.new.load("my/awesome/ruspea/script.rsp")

You can also bypass the file loading:

require "ruspea-lang"

code = <<~c
(def plus1
  (fn [num] (+ num 1)))
(plus1 10)
c

eleven = Ruspea::Code.new.run(code).last
puts eleven # => 11

Is this a functional language? Is it interpreted?

Yes.

Does it have a REPL?

YES! After install it as a gem (gem install ruspea_lang), just go ahead and:

➜ ruspea
loading repl: repl.rsp
repl loaded.

#user=> (def lol 1)
1
#user=> lol
1
#user=> (puts "hello world")
hello world
nil
#user=> ^CSee you soon.

Humm... but what about the Ruby stuff? And the gems?! HUH!?

Ruspea has Ruby interoperabillity built-in so you can "just use" Ruby:

(def puts
  (fn [str]
    (.
      (:: Kernel) puts str)))

In fact, the very minimal standard library is built on top of this interop capability. It is also the best source to look for usage/syntax/etc right now: lib/language/standard.rsp

OH! I see! Was this inspired by Clojure?

100%!

OH! I see! Is this as good as Clojure!?

LOL

Why would I use that, though? All those parenthesis...

This is the actual question, isn't it? Sadly this is way out of the scope of this README.

You will need to convince yourself here. 😬

Is this ready for production usage?

Nope. And it will probably never be.

This was just an exercise:

  • Ruby is really fun.
  • Lisp too.
  • I am really (I mean REALLY) enjoying Clojure.
  • And I really wanted to learn how to implemente a programming language.
  • Lists are a great way to organize thoughts.

If you put all this together you have this project.

Shortcomings

Actually, I would prefer to avoid the term shortcomings.

The current social norm forces impossible standards on everyone and everything!

I want to list the things I know are not perfect about this pretty little thing called Ruspea and I don't want to hurt it's feelings.

Let's call those rough edges... features. Those are enhancements that are not here... just yet 😬.

Ironic

Features

  • No performance! Seriously. There is no optmization whatsoever to see here.
  • No TCO. Goes hand to hand with the previous one.
  • No standard library.
  • No multi-arity functions. They are in the Runtime though. Just too lazy to build the syntax reader for it right now.
  • No examples. Besides the "standard library" ones (lib/language)

Installation

Add this line to your application's Gemfile:

gem "ruspea_lang"

And then execute:

$ bundle

Or install it yourself:

$ gem install ruspea_lang

Why not just ruspea? Do we really need a _lang suffix?!

Yes, we do:

Pushing gem to https://rubygems.org...
There was a problem saving your gem: Name 'ruspea' is too close to typo-protected gem: rspec

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mistersourcerer/ruspea.

License

The gem is available as open source under the terms of the MIT 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].