Working on a Custom Backend for Odin

Ginger Bill  — 1 month, 2 weeks ago
For the past few months, Odin has been using LLVM as its backend (with Microsoft's Linker) to compile to machine code (and before that I compiled to C). It has done its job whilst the language has grown to what it is now.

As a continuing project for Odin, we are going to create a new backend. The backend will use a form of Static Single Assignment (SSA) to do the majority of its optimizations, which can be lowered to a generic byte code. From this generic byte code, it can be further specialized to the needed machine architecture ...
Read More →

Below is a copy of a discord "conversion" between (mostly) me and ezysigh about problems with compile time execution and maybe a partial solution to the problem. This is recorded here for future reference.
n.b. It includes all my amazing typos, grammatical errors, and swearing.

[10:30 PM] ezysigh: Have you added meta/compiletime stuff yet?
[10:30 PM] gingerBill: Not yet as I'm still designing it.
[10:30 PM] gingerBill: I usually design the feature first then implement it.
[10:31 PM] ezysigh: (sorry, i didn't looka the videos... I kind of burned out of trying ...
Read More →

The Metaprogramming Dilemma

Ginger Bill  — 4 months, 4 weeks ago
Designing this language has been difficult but fun. Two of the original goals of this language were simplicity and metaprogramming however, these together could be an oxymoron. But before I explain why, I first need to explain what I mean by "metaprogramming".

Metaprogramming is an "art" of writing programs to treats other programs as their data. This means that a program could generate, read, analyse, and transform code or even itself to achieve a certain solution. The approaches of metaprogramming can be split into a few distinct categories:

  • Introspection (and Reflection for OOP languages)
  • Compile Time Execution (CTE)
  • Template Programming ...
Read More →

Odin v0.0.3c

Ginger Bill  — 5 months ago
[Odin v0.0.3c](

What's New

  • Rewritten in C99 (from C++)
  • `nil` - Zero value for all types, except:
    • integers
    • floats
    • strings
    • booleans
  • Maybe types (nillable types)
    • `m: ?int; ...; i, ok := m?;`
  • `match type` for `any`
  • `union_cast`
    • `x, ok := var union_cast Foo.Bar`
  • Backend and stability improvements

Bug fixes
  • `#import "..." as .` will not act like `#load` and keep imported entities local to that file
  • Initialize global memory at compile time if possible

  • Fix enums with duplicate entries crash
  • Remove some duplicate error messages

Linux and OSX

Coming Soon™

Read More →

The Odin License

Ginger Bill  — 5 months ago
Copyright (c) 2016 Ginger Bill. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

Read More →