Skip to content
/ shiika Public
forked from shiika-lang/shiika

A statically-typed scripting language

Notifications You must be signed in to change notification settings

D1mon/shiika

 
 

Repository files navigation

Shiika

A statically-typed programming language.

Example

    class A
      def fib(n: Int) -> Int
        if n < 3
          1
        else
          fib(n-1) + fib(n-2)
        end
      end
    end
    A.new.fib(34)

Status

Early-alpha

Implementation (Rust, src/*)

  • Implement class method (eg. Math.pow)
  • Implement .new
  • Local variables
  • break
  • String
  • Array
  • Instance variables
  • Blocks
  • Constant
    • Toplevel
    • Namespaced (eg. A::FOO)
  • Modules
  • Enums
  • ...

TODO

  • lambda/function(block)
  • Module (like Ruby's Module)
  • Enum
  • Constants
  • Check all ivars will be initialized (like Swift)
  • ...

Type system (Prototype in Ruby, lib/*)

  • Class method, instance method
  • Basic generics
  • Variable-length arguments
  • Array literal
  • Inheritance

Example

    class Pair<S, T>
      def initialize(@a: S, @b: T)
      end

      def fst -> S; @a; end
      def snd -> T; @b; end
    end
    Pair<Int, Bool>.new(1, true).fst

Development

Prerequisits

  • Rust
  • LLVM (brew intall llvm@7)
  • bdw-gc 7.6.0 (Currently the path is hardcorded in src/main.rs. PR welcome)
  • Ruby (used to generate boiler-plate library definitions)

Compile

$ bundle install
$ rake build

Run tests

$ rake test

How to run a Shiika program

$ ./build/debug/shiika run examples/fib.sk

License

MIT

Contact

https://github.com/yhara/shiika/issues

About

A statically-typed scripting language

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 71.7%
  • Ruby 25.2%
  • HTML 3.1%