Code Monkey home page Code Monkey logo

occult's Introduction

The Occult Language

An enigmatic programming language.

occultang.org

About

Occult aims to be a memory-safe, statically typed programming language with an elegant syntax similar to Rust and the performance of C. It achieves this by cross-compiling Occult code into C and using tinycc as both a just-in-time (JIT) and ahead-of-time (AOT) compiler.

In Occult, dynamic arrays are the default array type, functioning similarly to vectors. These arrays are managed by tgc, a lightweight garbage collector implemented in C. Occult enforces the use of stack-based variables, promoting predictable memory management and reducing the risk of dangling pointers. However, it also allows for heap allocations using tgc's malloc implementation, which the garbage collector automatically frees.

Building

Assuming you have git gcc, and other required dependencies installed, all of this should go smoothly.

Warning

Occult uses tgc which causes undefined behavior but most of the time it should be fine, as per tgc's documentation.

Building on Linux (64-bit)

  1. Run build.sh

Building on Windows

Important

Even if you have gcc installed, you must follow this for now!

  1. Run install_gcc.bat
  2. Run build_windows.bat

Using Occult

Tip

If you need help use the -h option!

./occultc <source.occ>

To-do

Note

The big overhaul to the language syntax and how it works. v2.0.0-alpha

Long-term

  • Windows support
  • OSX Support
  • Bootstrapping
  • Move away from cross-compilation for just-in-time
  • Memory safety as far as we can get it
  • Full static analyzer
  • Fixing bugs
  • Better multidimensional array syntax
  • Add string-supported function calls + other types (array, etc.)
  • Module system

Temporary

  • Add a "compilerbreakpoint" keyword (stops codegen / program during compilation)

occult's People

Contributors

finalxvd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

39yy01

occult's Issues

Multidimensional arrays

With my current array implementation in occlib there is a slight complexity while adding multidimensional arrays, while it is supported, it is more complex than I'd like...

Although I can probably get around it by modifying code_gen.hpp slightly, I have to work and modify how arrays are made now, which would require A LOT of refactoring. In the compiler itself, I can log the types inside the function arguments

std::vector<std::string> symbols;
and check it against the actual func itself, as we wont have variadic. This will help figure out what type we need to use for each array... (this is a huge hassle)

enhancing for loops even further

adding strings to for loops
fixing range + step_by because it doesn't support function calls / expressions it only supports number literals and identifiers.

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.