Giter Site home page Giter Site logo

tai-rex / sonic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soniclang/sonic

0.0 0.0 0.0 24 KB

Sonic language: Heavily inspired by Swift, but compiles to C so you can use it anywhere.

License: GNU Lesser General Public License v2.1

Swift 100.00%

sonic's Introduction

Sonic

Sonic programming language: Heavily inspired by Swift, but compiles to C so you can use it anywhere.

Brought to you by Chris Hulbert and Andres Kievsky!

Please considering sponsoring the work: github.com/sponsors/chrishulbert

Getting started

You call this a programming language? You call this a super computer?

Open the project in Xcode, run it, and see what it output in the console. So far we only have a Lexer and ambition.

About

WHAT'S WRONG WITH THIS SONIC LANGUAGE? IT'S MAKING CRAZY NOISES.

Swift is a fantastic language, but is tied really strongly to the Apple ecosystem, as well as LLVM. I've been thinking for years that it'd be great if we could make a Swift -> C compiler that could be used anywhere. When we started doing this, it became apparent that Swift is a vastly complex language, and so rather than making another Swift compiler, we're starting a new language that is more or less a simplified subset of Swift, and calling it Sonic.

  • Memory management is intended to use automatic reference counting.
  • We're aiming for the standard library to be comparably featureful to Go's stdlib. We find that several popular languages with skinny stdlibs to suffer from '1000 dependencies to get anything done' syndrome, and for this to be really scary in terms of supply-chain poisoning. A high-quality stdlib will mitigage this.
  • We've been inspired by Zig's success and hope to emulate this! In that vein, I'm accepting donations.
  • We'd love to make an incremental compiler that is as fast as TCC, to "Optimize for programmer happiness" as the Rails folk like to say. We might kill a few sacred cows to this end.
  • The BHAG is to use Sonic as the foundation for a cross-platform mobile app development framework, something akin to React Native.

Current status

And you call it a language despite the fact it is obviously just a lexer.

So far we have a lexer! This is the first step. We're working on the parser next. The lexer takes source code and outputs tokens. The parser takes the tokens and outputs an Abstract Syntax Tree. Andres has already begun work on the final step: converting an AST into C.

License

WHEW! ALL THIS LICENSING IS MAKING ME THIRSTY.

I've decided to go with the LGPL. I am not a lawyer, but the gist of it is: You can't fork this and make it closed-source. However if you use this as part of a larger project, the larger project can be licensed as you wish. I think that's a healthy balance. If this project proves popular and there is a lot of demand for relicensing to eg MIT, we'll certainly consider it!

sonic's People

Contributors

chrishulbert 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.