

GitHub - soniclang/sonic: Sonic language: Heavily inspired by Swift, but compile...
source link: https://github.com/soniclang/sonic
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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
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
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
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
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!
Recommend
-
37
小米 8 - Heavily 'inspired' by the iPhone X,售价 2699 起 - NEXT
-
12
ProductFinding Startup Ideas and Building in Heavily-Regulated Spaces — Lessons from Cash App & Carbon HealthThis art...
-
16
The latest data from crypto data aggregator Santiment has shown that Cardano is still the number one blockchain by average daily development on GitHub. With an average of 403 daily commits, Cardano has surpassed Ethereum with 369, Polkadot wi...
-
12
SmartData Collective > Big Data > Why New Email Clients Rely Heavily on the Latest Big Data Advances Why New Ema...
-
7
The most obfuscated Go-developed ELF-formatted malware we've found to date. Overview Recently, a malicious backdoor program written in the Go language that exploits an unauthorized access...
-
6
Cowgol 2.0 What? Cowgol is an experimental, Ada-inspired language for very small systems (6502, Z80, etc). It's different because it's intended to be self-hosted on these devices: the end goal is to be able to rebuild the en...
-
13
Jelly Jelly is a golfing language inspired by J. Documentation Quickstart The Jelly interpreter requires Python 3. To download, install, and use Jelly, proceed as follows. $ git cl...
-
9
An Elm-inspired language that transpiles to TypeScript Usage You can run the derw compiler via npx. You must provide files via --files. npx @eeue56/derw Compiles Derw code Provide entry files via --...
-
6
Hera is a monospace font which is a customised version of Source Code Pro which was originally created by Paul Hunt. Hera consists mainly of glyphs from Adobe Source Code Pro mixed with glyphs from popular monospace fonts like Fira Mon...
-
12
Table of contents fp programming language fp is a programming language heavily inspired by the language John Backus described in his 1977 Turing Award lecture. The paper can be found
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK