Giter Site home page Giter Site logo

cosmo-lang / cosmo Goto Github PK

View Code? Open in Web Editor NEW
15.0 1.0 3.0 7.71 MB

A simple statically-typed language written in pure Crystal.

Home Page: https://cosmo-lang.dev

License: MIT License

Makefile 0.14% Crystal 99.86%
lang language crystal statically-typed interpreter

cosmo's Introduction

build

Cosmo

Cosmo is a statically-typed interpreted programming language written in pure Crystal.
We have an extension for VS code (source), however it currently only features syntax highlighting and code snippets.

Successor

Cosmo has been succeeded by P.

Installation

Download the Cosmo Installer and run it.
You can also demo the language using the Cosmo bot in my Discord server.

Contributors

Contributing

There is a guide about how to contribute here on our website.
You can find any documentation you might need to contribute here. It's a page automatically generated by Crystal containing documentation for all classes, modules, etc.

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Test your code (make test)
  5. Push to the branch (make publish)
  6. Create a new Pull Request

Have any questions or comments? DM me or @ me in my server on Discord.

Things I Might Do

  • Named arguments
  • Make a Cosmo->C compiler
  • C bindings

Things I Gotta Do

Features

  • Grammar
    • Regexes
    • Endless (and beginless?) range literals
    • Postfix every loop (e.x. x < 1 for every int x in vec)?
    • typeof
    • Multiple assignment/declaration with spreads (e.x. int x, y = *[1, 2])
    • := operator (this will include making = binary expressions a statement [this is gonna be weird to implement lmao])
    • Enums
    • Decorators
    • Interfaces
    • Namespaces
    • Classes
      • single inheritance
      • mixins
      • static/protected members
    • Rewrite type system
      • bound expressions (!!)
      • an actual type pass
      • generics
      • type inference
      • casting union types
      • implicit conversions
      • intersection types
  • Other
    • Extend HTTP library
      • routing stuff
    • + operator for vectors, same functionality as Vector->combine
    • string and char to hex conversions (e.x. <uint>'f' == 15)
    • Some form of multithreading
    • Intrinsic methods for all datatypes (inherit from a base type)
    • REPL supports multiline source
    • Colorize REPL input

Fixes

  • Performance boosts lol
  • Parser does not recognize imported classes as type (WHY???)
  • Access imported aliased types
  • Access types within tables (e.x.JSON::Any)
  • More detailed errors when unable to resolve a type
  • Import stack traces
  • Properly log errors from intrinsics
  • Segfaults
    • passing $? (pretty sure this is just like everything to do with classes)
    • <float[]>[1,2,3]
  • Class instance variables available outside of $
  • Throw if same module was imported twice
  • ["a.b.c"].first.split('.') tries to access ["a.b.c"].first instead of ["a.b.c"].first() because of the split call with parentheses (bug)

Tests

  • Chained method calls with optional parentheses (e.x. ["a.b.c"].first.split('.').first == "a")
  • Expectation of errors in parser spec (e.x. () throws Invalid syntax ')': Expected an expression)
  • New intrinsic libraries

Refactorings

(empty)

Meta

  • Package manager (Stars + StarsAPI) (WIP)
  • Documentation generator?
  • Language server
  • Highlight function definition names without parentheses

Docs

(empty)

cosmo's People

Contributors

kevinalavik avatar quasar098 avatar r-unic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.