All Projects → schwalbe-sprach → schwalbe

schwalbe-sprach / schwalbe

Licence: MIT license
"Transpiler" from the Schwalbe Programming Language to Swift

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to schwalbe

yahdl
A programming language for FPGAs.
Stars: ✭ 20 (-28.57%)
Mutual labels:  transpiler
Py2Jl.jl
Python to Julia transpiler.
Stars: ✭ 67 (+139.29%)
Mutual labels:  transpiler
purenix
Nix backend for PureScript. Transpile PureScript code to Nix.
Stars: ✭ 227 (+710.71%)
Mutual labels:  transpiler
phptojs
PHP-to-JavaScript transpiler
Stars: ✭ 29 (+3.57%)
Mutual labels:  transpiler
transpiler
ABAP to JS transpiler
Stars: ✭ 57 (+103.57%)
Mutual labels:  transpiler
foolang
A toy programming language.
Stars: ✭ 33 (+17.86%)
Mutual labels:  transpiler
clava
C/C++ Source-to-Source Tool based on Clang
Stars: ✭ 55 (+96.43%)
Mutual labels:  transpiler
claw-compiler
CLAW Compiler for Performance Portability
Stars: ✭ 38 (+35.71%)
Mutual labels:  transpiler
cotowali
A statically typed scripting language that transpile into POSIX sh
Stars: ✭ 551 (+1867.86%)
Mutual labels:  transpiler
bashscript
TypeScript to bash transpiler. Because.
Stars: ✭ 37 (+32.14%)
Mutual labels:  transpiler
bfpile
Optimizing Brainfuck compiler, transpiler and interpreter
Stars: ✭ 19 (-32.14%)
Mutual labels:  transpiler
Gloa
Glóa - a statically typed language that compiles to Lua. *UNDER DEVELOPMENT*
Stars: ✭ 19 (-32.14%)
Mutual labels:  transpiler
Craxe
Haxe to nim transpiler
Stars: ✭ 39 (+39.29%)
Mutual labels:  transpiler
webfx
A JavaFX application transpiler. Write your Web Application in JavaFX and WebFX will transpile it in pure JS.
Stars: ✭ 210 (+650%)
Mutual labels:  transpiler
phpify
Compiles PHP modules for the browser with Uniter.
Stars: ✭ 18 (-35.71%)
Mutual labels:  transpiler
jazzle
An Innovative, Fast Transpiler for ECMAScript 2015 and later
Stars: ✭ 65 (+132.14%)
Mutual labels:  transpiler
kithon
Python to any languages transpiler
Stars: ✭ 33 (+17.86%)
Mutual labels:  transpiler
lua-in-js
A Lua to JS transpiler / runtime
Stars: ✭ 37 (+32.14%)
Mutual labels:  transpiler
AutoWIG
Automatic Wrapper and Interface Generator
Stars: ✭ 107 (+282.14%)
Mutual labels:  transpiler
sidef
A modern object-oriented programming language implemented in Perl.
Stars: ✭ 109 (+289.29%)
Mutual labels:  transpiler

Schwalbe

Travis

This is a transpiler from the Schwalbe programming language to Swift. Schwalbe carries exactly the same syntax as Swift, only completely in German. So basically the tool found here is nothing more than a translator based on a very "serious" discussion originating in the SwiftDE Slack. Please don't actually use it ☝️! See below for some syntax examples.

Since Schwalbe and Swift are perfectly equivalent regarding their syntax the current implementation of this tool is not very clever. It's actually rather stupid, does no syntax checking whatsoever, will ignore misspelled keywords and replace any possible schwalbe keywords with their swift equivalent (even inside strings and comments 👷), so be sure not to use them, there will be no warning. But it's not like you're actually wanting to use this for something, right? 🤔

Why "Schwalbe"? Because I'm an idiot and thought a swift and a swallow are the same birds. (The proper German translation of Swift would have been Mauersegler.) And the german word for swallow is Schwalbe. Quoting Wikipedia on my mistake:

They are superficially similar to swallows, but are not closely related to any of the passerine species.

Usage

If a single file is given, schwalbe will output it's translated content directly, enabling you to pipe it into a swift source file.

$ schwalbe beispiel.schwalbe > example.swift

For an input of multiple files schwalbe will create an output directory called schwalbe_output and copy all input files into this directory processing any file with a .schwalbe extension in the process. This enables you to translate an entire directory at once, since the directory structure is also kept as is.

$ schwalbe **/*

# ⚙️ Processing example.schwalbe...
# Writing schwalbe_output/example.swift
# All done ✅

Installation

$ brew tap kiliankoe/formulae
$ brew install schwalbe

If you're an Atom user, here's a package for you to enable syntax highlighting for Schwalbe code

$ apm install language-schwalbe

Syntax Examples

Here's some quick examples to get you up to speed with Schwalbe in your own projects.

For a complete list of all supported keywords, check syntax.md.

For a slightly more extended example, have a look here.

drucke("Hallo, Welt!")
struktur Person {
    sei name: Zeichenkette
    sei alter: Ganzzahl

    funktion gibAus() {
        drucke("Name: \(selbst.name), Alter: \(selbst.alter)")
    }
}

sei max = Person(name: "Max Mustermann", alter: 21)
max.gibAus()
var preise = Zuordnung<Zeichenkette, Fließkommazahl>()
preise["Milch"] = 0.99
preise["Butter"] = 1.49

(GitHub seriously needs syntax highlighting for Schwalbe code... See #11)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].