Skip to content

shiika-lang/shiika

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
doc
 
 
 
 
lib
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

logo Shiika

Shiika is a programming language that makes me most productive.

  • Easy to write like Ruby or Python
  • Static type checking (Null safety!)
  • Object-oriented but has enums and pattern-matching
  • Written in Rust, compiles to single binary via LLVM IR

Concept

Most of the static typing languages, such as C++/Java/Scala/Go/Swift/Kotlin/Rust, etc. are designed for execution speed. However what I want a "lightweight" static typing language to make application faster.

Design policy

  • Easiness over performance
    • Shiika is a glue language. Use Rust (or C, etc.) for performance-critical parts and load it as a library
  • Easy to learn
    • There may be more than one way to do it, but not too many.

Comparison to Crystal

Shiika has lots in common with Crystal. However:

  • In Shiika, type annotation of method parameters are mandatory. This helps reading programs written by others
  • Shiika has only one class Int for integers (cf. Int8, Int16, Int32 in Crystal)
  • Shiika does not have union types. The type system is more similar to languages such as Rust, Java or Swift (this isn't good or bad; just a difference)

Example

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

See examples/*.sk for more.

Install

install.md

Documents

Status

Early-alpha; capable of solving algorithmic problems like Advent of Code but a lot more stdlib is needed for practical application.

Features already implemented

  • Classes, Modules, Enums
  • Basic Generics
  • Basic pattern-matching
  • Anonymous function
  • Core classes - Object, Array, String, Bool, Int, Float, Dict, Maybe, Class, Metaclass

See tests/sk/ and examples/ for more.

Features not yet implemented

  • Something like Ruby's require
  • Type inference
  • More stdlib like Time, File, etc.

See Issues for more.

Help wanted!

  • Syntax support for editors, especially Vim (yes I use Vim)
  • Fix parser to trace location information
    • i.e. add location to AST
    • and HIR
    • Then we can improve error message greatly
    • and it can be used for LLVM debug info

Roadmap (tentative)

  • v0.1.0 - Type system POC
  • v0.2.0 - Start writing with Rust
  • v0.3.0 - Generics
  • v0.4.0 - Anonymous function (lambda)
  • v0.5.0 - Virtual methods
  • v0.6.0 - Generic methods
  • v0.6.0 - Enums, basic pattern matching
  • v0.7.0 - Modules (like Ruby's module)
  • v0.8.0 - More stdlib (File, etc)
  • After v1.0.0
    • Language enhancement
      • Default arguments
      • Keyword arguments passing
    • Built-in library
      • Bignum, etc
    • Standard library?
      • Http, etc?
    • Package system
    • Some meta-programming feature (but not AST macro, sorry lisp fans)

Supported platform

  • Tested on Mac, Linux(Ubuntu) and Windows
  • May not work on 32bit environment

Hacking

See install.md

Run tests

$ cargo test

Only integration tests (test/sk/*.sk):

$ cargo test --test integration_test

Specific file under test/sk/ (eg. string.sk):

$ FILTER=string cargo test --test integration_test

With logging enabled

$ RUST_LOG='trace' cargo test

Troubleshooting

  /Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: syntax error near unexpected token `disable-shared'                                                                        
  /Users/yhara/.cargo/registry/src/github.com-1ecc6299db9ec823/bdwgc-alloc-0.6.0/vendor/libatomic_ops/configure: line 4683: `LT_INIT(disable-shared)'  

=> brew install libtool

License

MIT

Contact

https://github.com/shiika-lang/shiika/issues

About

A statically-typed programming language

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published