GithubHelp home page GithubHelp logo

shiika-lang / shiika Goto Github PK

View Code? Open in Web Editor NEW
223.0 8.0 15.0 2.69 MB

A statically-typed programming language

License: MIT License

Ruby 0.46% Rust 99.28% Shell 0.12% Dockerfile 0.14%
language rust

shiika's Introduction

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.

Roadmap

  • v0.10.0~
    • Type system: Upper and lower bound
    • Type system: Variance specifier
    • Syntax: .try!
    • Semantics: Non-local return
    • Built-in: Bignum, Rational?
    • Built-in: Dir, Process
    • Built-in: Split Array and MutableArray?
    • Simple package system (shiika build)
  • After v1.0.0
    • Some meta-programming feature (like Crystal?)
    • Some mechanics for parallel computation

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

License

MIT

Contact

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.