Giter Club home page Giter Club logo

jorbdehmel / oak Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 2.0 1.81 MB

The Oak Programming Language. Oak is a modern, low-level, statically-typed translated programming language with extreme macro support, built-in packaging and building, and compile-time-modifiable language syntax. Oak's syntax modification makes it a powerful core for the construction of new programming languages.

License: GNU General Public License v3.0

Makefile 1.09% C++ 85.20% Shell 0.10% C 13.51% Nix 0.10%
assembler compiler language programming-language programming-language-development tools translator

oak's Introduction

The Oak Programming Language

Summary README: See docs/manual.md for full documentation.

Test Badge

Jordan Dehmel, [email protected]
github.com/jorbDehmel/oak

Overview

Oak is a modern low-level functional programming language with compile-time modifiable syntax. Its usecase is in low-level language and compiler design (see the later section on dialects). Oak also aims to have an integrated build system, necessitating only one call to the compiler per executable.

This git repository contains the source code for the acorn Oak compiler, as well as some standard packages (extra, std, stl, and turtle) and tests suites.

Oak is most closely related to C, but also has strong macro support, modern typing, generics, compile-time syntax modification and integrated package management. An interesting consequence of Oak's compile-time modifiable syntax is that Oak can be a high or low level language, depending on the rules / dialect applied.

Did You Say "Compile-Time-Modifiable Syntax"?

Oak has compile-time-modifiable syntax (see the section on preprocessor rules), making it highly customizable and flexible in a way that no other mainstream languages are. In Oak, if you think the language should have a certain shorthand, you can create it. Oak can similarly be a testing ground for new language syntaxes. It supports the creation of "dialects", which are Oak variants which use preprocessor rules to support independent syntactical structures.

Note: Oak has a default syntax, called canonical Oak. It also has the std dialect, provided by the std package. The later is more commonly used. Syntax modifications must be opted into on a file-by-file basis, or specified by the compiler via the use of dialect files.

Compilation, Installation, and Uninstallation

Oak is not compatible with Windows. Oak assumes a UNIX system.

To install, open a terminal in this folder and run make install. This will compile and install Oak, as well as the standard Oak package. To uninstall, call acorn -A. To update, call acorn -a.

To install all the default Oak packages, run make packages in this folder. If this is not run, only the std package will be installed. More information about the included packages can be found in docs/manual.md.

Versions of Oak

Oak versions follow the following format.

major release.minor release.patch

As of the time of this writing, Oak is still on major release 0. During this phase of development, Oak is not stable. This means that code written in one minor release or patch is not guaranteed to work in another.

Once Oak moves to major release 1, code written in one patch version will be guaranteed to work in another. Code written in one minor release will most likely work in another. Code written in one major release will have no guarantees about any other.

For More Help

More help can be found in the full Oak manual, which can be found at ./docs/manual.md. A suite of examples can be found in ./src/tests. Please report any bugs on and forward any specific questions to github.com/jorbDehmel/oak.

oak's People

Contributors

jorbdehmel avatar lemonjamesd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lemonjamesd

oak's Issues

Add negation, incrementation and decrementation

In the past, unary operators have been avoided in Oak
because only a binary operator substitution pass was initially
written. This should be remedied. The following should be
added during the operation-substitution pass of compilation.

  • Add negation operator (IE !a)
  • Add increment operator (IE ++a)
  • Add decrement operator (IE --a)

Bug (I assume) when writing if statement.

package!("std");
use_rule!("std");

let main() -> i32 
{
	let one: u8 = 1;
	if (one != to_u8(1) == false)
	{
		print("Worked!\n");
	}
}

Will compile.

package!("std");
use_rule!("std");

let main() -> i32 
{
	let one: u8 = 1;
	if ((one != to_u8(1)) == false)
	{
		print("Worked!\n");
	}
}

Will not compile.

Integrating method call notation

The current method call notation provided by the
std ruleset is broken and slow. This feature is
widely-used enough that it justifies integration into
the canonical syntax.

  • Integrate method call notation
  • Make method call notation work on nested objects (IE a.b.c.d())

Efficiency boosts in `doFile`

The main operations on the input token stream are performed
when it is in a vector. This should be transitioned to a list
instead, for obvious efficiency reasons.

Massive Memory Leak

// main.oak
package!("std");
use_rule!("std");

include!("linked_list.oak");

let main() -> i32
{
    0
}
// linked_list.oak
package!("std");
use_rule!("std");

let linked_list<t> = struct
{
    next: ^linked_list<t>,
    data: t
}

Causes a giant memory leak (4gb at least).

Add `mut` keyword for types

This would disambiguate the current const/mut typing situation, in which mutability is denoted via pointer.

  • Add mut keyword
  • Do checks for mut when attempting to change values

Errors w/ implicit type casting reducing precision

acorn will select invalid function candidates which cause
loss of precision, leading to undefined behavior. This can
be solved by a refinement of the candidate selector or by
disallowing precision-lowering implicit casts.

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.