Skip to content

Commit e8fb88b

Browse files
authored
Merge pull request #3 from Asa-Programming-Language/main
update dev
2 parents df7551e + 6f933b1 commit e8fb88b

File tree

12 files changed

+261
-98
lines changed

12 files changed

+261
-98
lines changed

.github/workflows/cmake-linux-x86.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525

26+
- name: Cache LLVM build
27+
uses: actions/cache@v3
28+
id: cache-dependencies
29+
with:
30+
# Adjust these paths to match where LLVM is built and installed
31+
path: |
32+
Asa-LLVM-Compiled
33+
/usr/lib
34+
/usr/include
35+
key: llvm-build-${{ hashFiles('Asa-LLVM-Compiled/llvm/**', 'Asa-LLVM-Compiled/build/CMakeCache.txt') }}
36+
restore-keys: |
37+
llvm-build-
38+
2639
2740
- name: Set up Ninja
2841
uses: ashutoshvarma/setup-ninja@93f8b9763516f1fb9b4d9840b12d844bee17791f
@@ -34,23 +47,30 @@ jobs:
3447
version: latest
3548
platform: x64
3649

37-
- name: Setup LLVM
38-
# You may pin to the exact commit or the version.
39-
uses: ZhongRuoyu/setup-llvm@v0.1.1
40-
with:
41-
llvm-version: 20
42-
43-
4450
# - name: Setup LLVM
45-
# run: |
51+
# # You may pin to the exact commit or the version.
52+
# uses: ZhongRuoyu/setup-llvm@v0.1.1
53+
# with:
54+
# llvm-version: 20
55+
56+
57+
58+
- name: Setup LLVM
59+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
60+
run: |
61+
git clone --depth 1 https://github.com/sam-astro/Asa-LLVM-Compiled
62+
cd Asa-LLVM-Compiled
63+
mkdir build
64+
cmake -S llvm -B build -G Ninja -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=MinSizeRel
65+
cd build
66+
ninja
67+
sudo ninja install
68+
cd ../../
4669
# git config --add remote.origin.fetch '^refs/heads/users/*'
4770
# git config --add remote.origin.fetch '^refs/heads/revert-*'
48-
# git clone --depth 1 https://github.com/llvm/llvm-project.git
4971
# cd llvm-project
5072
# git fetch origin 7615503409f19ad7e2e2f946437919d0689d4b3e
5173
# cmake -S llvm -B build -G Ninja -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_BUILD_TYPE=MinSizeRel
52-
# cmake --build build
53-
# cmake --install build
5474

5575

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

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
<picture>
33
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/sam-astro/ASA/blob/main/media/ASA-Full.png?raw=true">
44
<source media="(prefers-color-scheme: light)" srcset="https://github.com/sam-astro/ASA/blob/main/media/ASA-Full-light.png?raw=true">
5-
<img alt="Asa Programming Language"
6-
src="https://raw.githubusercontent.com/sam-astro/ASA/main/media/ASA-Full-light.png"
7-
width="60%">
5+
<img class="portfolio" src="https://raw.githubusercontent.com/sam-astro/ASA/main/media/ASA-Full-light.png" width="60%" alt="Asa Programming Language" >
86
</picture>
97
</div>
108

@@ -14,6 +12,8 @@
1412

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

15+
> There are no releases currently, and much of the current code is subject to change
16+
1717
<!----------------------------------------------------------------------------->
1818

1919
[License]: LICENSE

examples/start/main.asa

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#import Builtin.PipeOperatorTest;
99

10+
#import Rendering.Window;
11+
1012
//#import GameLogic;
1113

1214
//#file "./function_redefine.asa";
@@ -28,25 +30,25 @@ create::string() #inline; #replaceable; {
2830
return *(#new string);
2931
}
3032
create :: string(c : *char) {
31-
s : string = *(#new string);
33+
s : string = string();
3234
puts("Creating new string from *char\n");
3335

34-
len : uint32 = 10;
35-
//for(i : 0..4_294_967_296){
36-
// //if(c[i] == '\0')
37-
// // break;
38-
// len++;
36+
//len : uint32 = 10;
37+
////for(i : 0..4_294_967_296){
38+
//// //if(c[i] == '\0')
39+
//// // break;
40+
//// len++;
41+
////}
42+
//s.address = malloc(10*2);
43+
//s.length = 10;
44+
////len = 5;
45+
////s.address = malloc(5);
46+
//for(i : 0..len){
47+
// s.address[i] = 'A';
48+
// //s.address[i] = c[i];
3949
//}
40-
s.address = malloc(10*2);
41-
s.length = 10;
42-
//len = 5;
43-
//s.address = malloc(5);
44-
for(i : 0..len){
45-
s.address[i] = 'A';
46-
//s.address[i] = c[i];
47-
}
48-
//s.length = len;
49-
//s.address = "String value example";
50+
////s.length = len;
51+
////s.address = "String value example";
5052
puts("Done!\n");
5153
return s;
5254
}
@@ -73,7 +75,7 @@ TEST_MACRO :: {printl("Macro works!")};
7375
//}
7476

7577
printint:: (n : uint64) #hideast {
76-
putchar(48+n);
78+
putchar(int(48+n));
7779
}
7880

7981
modifyReference::(n : ref int) #hideast {
@@ -103,11 +105,13 @@ main :: (){
103105

104106
//var : bool;
105107

108+
pipeVal = pipeTest(1);
109+
printint(pipeVal);
110+
newline();
111+
106112
s : string = string();
107113
s = string("This works");
108114

109-
pipeTest(1);
110-
111115
//s.length = 8;
112116
//printint(s.length);
113117
//s.size();
@@ -116,6 +120,7 @@ main :: (){
116120
printint(s.length);
117121
newline();
118122
s.print();
123+
newline();
119124
puts("Done!");
120125

121126
newline();
@@ -132,7 +137,7 @@ main :: (){
132137
//x = x+1;
133138
//putchar(*x_ptr);
134139
//putchar(32);
135-
140+
//
136141
//arr : *int = malloc(8*4);
137142

138143
//arr[2] = 72;

modules/Builtin/asa.asa

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ Strings :: module{
178178

179179
PipeOperatorTest :: module{
180180
fnX :: int(x : int){
181-
return x*5;
181+
return x*3;
182182
}
183183
fnY :: int(y : int){
184-
return y*5;
184+
return y*2;
185185
}
186186
pipeTest::int(z : int){
187187
return fnX(z) -> fnY(%);

modules/Rendering/window.asa

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
Window :: module{
3+
4+
}

0 commit comments

Comments
 (0)