Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from StellarWitch7/dev
Browse files Browse the repository at this point in the history
A handful of patches
  • Loading branch information
StellarWitch7 authored Apr 24, 2024
2 parents c571cb0 + 85fa211 commit 5a8d8f3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 0 additions & 1 deletion Moth.Compiler/Moth.Compiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<StartupObject>Moth.Compiler.Program</StartupObject>
Expand Down
1 change: 0 additions & 1 deletion Moth.Luna/Moth.Luna.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<StartupObject>Moth.Luna.Program</StartupObject>
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
Moth's official compiler, written in C#. It takes Moth code and converts it to LLVM IR, which is then passed to the Clang C compiler. Currently only compatible with the Clang compiler. Read the [wiki](https://github.com/StellarWitch7/Moth/wiki) for Moth's documentation. Please report any bugs to the [issue tracker](https://github.com/StellarWitch7/Moth/issues), as it helps to improve Moth's compiler.

### Dependencies
1. Microsoft .NET Core 7
2. Clang version >=16
3. Git and Git Extras
1. [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0)
2. [Clang 16](https://clang.llvm.org/get_started.html)
3. [Git](https://git-scm.com/downloads)
4. [Git Extras](https://github.com/tj/git-extras)

### Arguments

Expand All @@ -18,14 +19,15 @@ Moth's official compiler, written in C#. It takes Moth code and converts it to L
Usage:
luna build [-v] [-n] [-c] [--no-advanced-ir-opt] [-p <path>] => Builds the project at the path provided or in the current directory if no project file is passed.
luna run [-v] [-n] [-c] [--no-advanced-ir-opt] [-p <path>] [--run-args <args>] [--run-dir <path>] => Builds and runs the project at the path provided or in the current directory if no project file is passed.
luna init [--name <project-name>] => Initialises a new project in the current directory.
luna init [--lib] [--name <project-name>] => Initialises a new project in the current directory.
-v, --verbose => Logs extra info to console.
-n, --no-meta => Strips metadata from the output file. WARNING: disables reflection!
-c, --clear-cache => Whether to clear dependency cache prior to build.
--no-advanced-ir-opt => Whether to skip IR optimization passes.
-p, --project => The project file to use.
--name => When initializing a new project, pass this option with the name to use.
--lib => When initializing a new project, pass this option to create a static library instead of an executable project.
--run-args => When running a project, pass this option with the arguments to use.
--run-dir => When running a project, pass this option with the working directory to use.
```
Expand Down
9 changes: 8 additions & 1 deletion test/main/main.moth
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
namespace test;

with core;
with core::threading;

func main() #i32 {
WriteLine("Hello World!");
local thread #Thread = #Thread.init(func(arg #void*) #void* {
WriteLine("Hello threaded world!");
return #i32*(&#i32(0));
}, null);

thread.Start();
Exit();
return 0;
}

0 comments on commit 5a8d8f3

Please sign in to comment.