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

Related tags

Miscellaneous sonic
Overview

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!

You might also like...
The most powerful Event-Driven Observer Pattern solution the Swift language has ever seen!
The most powerful Event-Driven Observer Pattern solution the Swift language has ever seen!

Event-Driven Swift Decoupling of discrete units of code contributes massively to the long-term maintainability of your project(s). While Observer Patt

It can help you to prepare yourself for interview 🚀

Note I will keep updating the content table as I am going through, keep connected to stay updated ! Contribution You can contribute here as well, crea

Ulangi is a language flashcards app with spaced repetition system and more.

Ulangi Open-source language learning tools Introduction Ulangi makes it easy for you to manage and create flash cards to learn languages. It comes wit

Use this template as a starting point for any Swift 5 module that you want other people to include in their projects

Swift 5 Module Template Use this template as a starting point for any Swift 5 mo

Open source Clips-inspired app.
Open source Clips-inspired app.

AlohaGIF Website Funny moments? Want to share it as a GIF, but you are worried that you will lose speech from video? Aloha will scan sound and attach

A fancy collection style view controller that was inspired by this Profile Card mockup
A fancy collection style view controller that was inspired by this Profile Card mockup

JFCardSelectionViewController A fancy collection style view controller that was inspired by this Profile Card mockup: https://dribbble.com/shots/14584

Quotes shows you famous quotes to, hopefully, give you enlightment
Quotes shows you famous quotes to, hopefully, give you enlightment

"Quotes" shows you famous quotes to, hopefully, give you enlightment! You can also save/favorite the quotes that you liked to review later or show to your friends!

A Swift playground that comes pre-loaded with Plot, that can be used to explore the new component API.

PlotPlayground A Swift playground that comes pre-loaded with Plot, so that you can quickly try out the library and its new, SwiftUI-like API for build

A gem which can gen VFS YAML file.

yaml-vfs A gem which can gen VFS YAML file. vfs yamlwriter lets you create clang opt "-ivfsoverlay" ymal file, map virtual path to real path. ✅ It can

Comments
  • Efficient (both in run-time as well as write-time) & scalable multicore parallelism

    Efficient (both in run-time as well as write-time) & scalable multicore parallelism

    In the today's world full of really cool and practical languages more or less fulfilling the goals Sonic seems to have, there is still one thing I'm utterly missing.

    Namely seamless, user-friendly, efficient (both in terms of time to write & debug/make_it_safe and running time), dynamic (it'll react in run-time to changing number & performance of available individual processing units - be it CPU, GPU, FPGA, ...) multicore parallelism.

    What are your plans in this regard?


    To understand the extent I'm talking about, feel free to read the initial post in the thread https://github.com/vlang/v/issues/1868 .

    opened by dumblob 0
  • Sample code (or general thoughts on direction)

    Sample code (or general thoughts on direction)

    This project is super interesting to me, since I've worked on several compilers that target C output and worked with several others. I was curious if yous have even a sketch of what yous were thinking wrt the syntax and semantics of the language, even if they are rough outlines. Furthermore, I'd be curious to see if enough compatibility with swift will be retained to lift the compiler once it can produce C, or if it will need to be rewritten/ported from the current Swift implementation.

    Thanks in advanced, this is super exciting!

    opened by lojikil 3
Owner
Sonic Language
Sonic Language
Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Sparrow Code 31 Jan 3, 2023
Tutorials from sparrowcode.io website. You can add new, translate or fix typos. Also you can add your apps from App Store for free.

Страницы доступны на sparrowcode.io/en & sparrowcode.io/ru Как добавить свое приложение Добавьте элемент в json /ru/apps/apps.json. Если ваше приложен

Sparrow Code 30 Nov 25, 2022
An experimental functional programming language with dependent types, inspired by Swift and Idris.

Kara An experimental functional programming language with dependent types, inspired by Swift and Idris. Motivation Development of Kara is motivated by

null 40 Sep 17, 2022
You can monitor your APIs and websites on your menubar. Gives you status code 🎉 Cool & good

Hope not. Monitor your APIs and websites on your menubar. For macOS. Right now! YyeeeHav!

Steven J. Selcuk 10 Nov 29, 2022
Are you sure the chemical compounds of your daily use are 100% safe? Use Chem-Aware, identify them right now!

View Project On Devpost: Built With: PubChem's REST API How To Install Chem Aware: Prerequiste: Latest Version of Xcode and Simulators installed The a

Jerry Zhang 5 Aug 23, 2022
A corresponding package to RxKotlin Plus, but for Swift and iOS

A corresponding package to RxKotlin Plus, but for Swift and iOS

Lightning Kite 0 Dec 15, 2021
Codable, but with Super power made custom Codable behavior easy.

Codable, but with Super power made custom Codable behavior easy.

Tsungyu Yu 24 Aug 30, 2022
A zero-code template app that demonstrates how to use TheraForge's APIs and can be used for fast prototyping

TheraForge MagicBox 1.0.0-beta The Open TheraForge (OTF) MagicBox app is a template for creating digital health solutions that help people better mana

TheraForge 0 Dec 23, 2021
SwiftTypeReader - You can gather type definitions from Swift source code.

SwiftTypeReader - You can gather type definitions from Swift source code.

omochimetaru 23 Dec 12, 2022
Pexels API client library for the Swift programming language.

Pexels-Swift Pexels.com API client library for the Swift programming language. Overview This Swift Package is a wrapper for Pexels API to get access t

Lukas Pistrol 4 Sep 1, 2022