Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 34 additions & 12 deletions .github/workflows/cmake-linux-x86.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Cache LLVM build
uses: actions/cache@v3
id: cache-dependencies
with:
# Adjust these paths to match where LLVM is built and installed
path: |
Asa-LLVM-Compiled
/usr/lib
/usr/include
key: llvm-build-${{ hashFiles('Asa-LLVM-Compiled/llvm/**', 'Asa-LLVM-Compiled/build/CMakeCache.txt') }}
restore-keys: |
llvm-build-


- name: Set up Ninja
uses: ashutoshvarma/setup-ninja@93f8b9763516f1fb9b4d9840b12d844bee17791f
Expand All @@ -34,23 +47,30 @@ jobs:
version: latest
platform: x64

- name: Setup LLVM
# You may pin to the exact commit or the version.
uses: ZhongRuoyu/setup-llvm@v0.1.1
with:
llvm-version: 20


# - name: Setup LLVM
# run: |
# # You may pin to the exact commit or the version.
# uses: ZhongRuoyu/setup-llvm@v0.1.1
# with:
# llvm-version: 20



- name: Setup LLVM
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: |
git clone --depth 1 https://github.com/sam-astro/Asa-LLVM-Compiled
cd Asa-LLVM-Compiled
mkdir build
cmake -S llvm -B build -G Ninja -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=MinSizeRel
cd build
ninja
sudo ninja install
cd ../../
# git config --add remote.origin.fetch '^refs/heads/users/*'
# git config --add remote.origin.fetch '^refs/heads/revert-*'
# git clone --depth 1 https://github.com/llvm/llvm-project.git
# cd llvm-project
# git fetch origin 7615503409f19ad7e2e2f946437919d0689d4b3e
# cmake -S llvm -B build -G Ninja -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=MinSizeRel
# cmake --build build
# cmake --install build


- name: Configure CMake
Expand All @@ -69,5 +89,7 @@ jobs:
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ./${{github.workspace}}/build/asa
run: |
cd ${{github.workspace}}/build
./asa -V

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/sam-astro/ASA/blob/main/media/ASA-Full.png?raw=true">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/sam-astro/ASA/blob/main/media/ASA-Full-light.png?raw=true">
<img alt="Asa Programming Language"
src="https://raw.githubusercontent.com/sam-astro/ASA/main/media/ASA-Full-light.png"
width="60%">
<img class="portfolio" src="https://raw.githubusercontent.com/sam-astro/ASA/main/media/ASA-Full-light.png" width="60%" alt="Asa Programming Language" >
</picture>
</div>

Expand All @@ -14,6 +12,8 @@

This repository contains all of the source code for the Asa programming language compiler and standard libraries.

> There are no releases currently, and much of the current code is subject to change

<!----------------------------------------------------------------------------->

[License]: LICENSE
Expand Down
45 changes: 25 additions & 20 deletions examples/start/main.asa
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#import Builtin.PipeOperatorTest;

#import Rendering.Window;

//#import GameLogic;

//#file "./function_redefine.asa";
Expand All @@ -28,25 +30,25 @@ create::string() #inline; #replaceable; {
return *(#new string);
}
create :: string(c : *char) {
s : string = *(#new string);
s : string = string();
puts("Creating new string from *char\n");

len : uint32 = 10;
//for(i : 0..4_294_967_296){
// //if(c[i] == '\0')
// // break;
// len++;
//len : uint32 = 10;
////for(i : 0..4_294_967_296){
//// //if(c[i] == '\0')
//// // break;
//// len++;
////}
//s.address = malloc(10*2);
//s.length = 10;
////len = 5;
////s.address = malloc(5);
//for(i : 0..len){
// s.address[i] = 'A';
// //s.address[i] = c[i];
//}
s.address = malloc(10*2);
s.length = 10;
//len = 5;
//s.address = malloc(5);
for(i : 0..len){
s.address[i] = 'A';
//s.address[i] = c[i];
}
//s.length = len;
//s.address = "String value example";
////s.length = len;
////s.address = "String value example";
puts("Done!\n");
return s;
}
Expand All @@ -73,7 +75,7 @@ TEST_MACRO :: {printl("Macro works!")};
//}

printint:: (n : uint64) #hideast {
putchar(48+n);
putchar(int(48+n));
}

modifyReference::(n : ref int) #hideast {
Expand Down Expand Up @@ -103,11 +105,13 @@ main :: (){

//var : bool;

pipeVal = pipeTest(1);
printint(pipeVal);
newline();

s : string = string();
s = string("This works");

pipeTest(1);

//s.length = 8;
//printint(s.length);
//s.size();
Expand All @@ -116,6 +120,7 @@ main :: (){
printint(s.length);
newline();
s.print();
newline();
puts("Done!");

newline();
Expand All @@ -132,7 +137,7 @@ main :: (){
//x = x+1;
//putchar(*x_ptr);
//putchar(32);

//
//arr : *int = malloc(8*4);

//arr[2] = 72;
Expand Down
4 changes: 2 additions & 2 deletions modules/Builtin/asa.asa
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ Strings :: module{

PipeOperatorTest :: module{
fnX :: int(x : int){
return x*5;
return x*3;
}
fnY :: int(y : int){
return y*5;
return y*2;
}
pipeTest::int(z : int){
return fnX(z) -> fnY(%);
Expand Down
4 changes: 4 additions & 0 deletions modules/Rendering/window.asa
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

Window :: module{

}
Loading