Git Product home page Git Product logo

iondotnet's Introduction

Ion Lang Compiler

This project is a compiler built using C# and .Net Core for the Ion Language. The Ion language is one which sits like a layer above the C language and abstracts away some of C's more annoying and archaic features. It transpiles into C99 source which can then be further compiled using a standard compiler such as GCC/VisualC. Although Ion does not stray far from its C roots, it does implement many modern features such as type inference, basic type reflection and code packaging. Like C it is procedurally based with features such as structs/enums and functions being the basic objects with which one works. Unlike C it has no need for header files, function definitions or macros.

Ion is part of something much bigger.

The Ion language was designed entirely by Per Vognsen. It is the central piece to the Bitwise educational project he created which aims to build an entire software and hardware stack for the RISC V CPU. The bitwise project can be found at the following links.

Handmade: https://bitwise.handmade.network/

YouTube: https://www.youtube.com/pervognsen

GitHub: https://github.com/pervognsen/bitwise

Discord: https://discord.gg/7TSA6ZF

Why I created IonDotNet.

The Ion language was originally created in C with the intention of then creating a self-compiling compiler. I wanted to follow along with Per when he created the streams but didn’t have the time. Instead I followed at my own time & pace. I feel the best way to accomplish this is not to just copy code in the language used. This leads to boredom and no real understanding is gained. I choose to transcribe the code into a second similar but different language. This forces you to read and grasp the code which leads to one gaining a much better understanding of two languages at the same time thus accelerating ones learning rate. I choose C# as the destination language since it shares its origin’s with C and although is a much higher-level language, it still allows direct access to memory using pointers and structs.

There are two versions here. The first is a direct port of the code to the C#. The code is very similar both in style and substance. In many cases the code is identical. I used C's naming and styling conventions to make going between this and Pers' code as easy as possible. Calls to the .Net framework is kept to a minimum. I wanted to see how fast could Native C# code run when compared to C. The second project called IonManaged uses .Nets containers and standard library in place of custom ones created in the orignial port. This project is suitable for using in tooling and as a library since memory is managed by the .Net Garbage Collector.

iondotnet's People

Contributors

clearz avatar

Watchers

 avatar

iondotnet's Issues

Memory Leaks?

One problem I have been having with ion.exe is the program tends to crash randomly returning -1073740940. A quick search will show that this is related to heap corruption. The strange thing is when I run this using WinDbg it works perfectly every time. Does anybody have any ideas?

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.