Compare commits
6
Commits
94d0e1db25
...
v0.0.13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41e1ac2592 | ||
|
|
215fde5a78 | ||
|
|
571e810d44 | ||
|
|
baeab65186 | ||
|
|
bf445ef68b | ||
|
|
adc0bc2985 |
+32
-28
@@ -5,7 +5,7 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TF_VERSION: 0.0.9
|
TF_VERSION: 0.0.11
|
||||||
PACKAGE_AND_BREW: ${{ secrets.PACKAGE_AND_BREW }}
|
PACKAGE_AND_BREW: ${{ secrets.PACKAGE_AND_BREW }}
|
||||||
VERSION: ${{ gitea.ref_name }}
|
VERSION: ${{ gitea.ref_name }}
|
||||||
RESULT_IMAGE_NAME: tesses50/crosslang
|
RESULT_IMAGE_NAME: tesses50/crosslang
|
||||||
@@ -22,8 +22,6 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: bash build-for-ppc.sh
|
- run: bash build-for-ppc.sh
|
||||||
- uses: akkuman/gitea-release-action@v1
|
- uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
|
||||||
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |-
|
files: |-
|
||||||
@@ -32,29 +30,29 @@ jobs:
|
|||||||
build-packages:
|
build-packages:
|
||||||
name: "🔨 Build for everything else"
|
name: "🔨 Build for everything else"
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- container: "git.tesses.org/tesses50/linux-x64:latest"
|
- container: "git.tesses.org/tesses50/linux-x64:latest"
|
||||||
puter: "msi-walmart"
|
puter: "asrock"
|
||||||
nfpmName: "amd64"
|
nfpmName: "amd64"
|
||||||
debianName: "x86_64-linux-gnu"
|
debianName: "x86_64-linux-gnu"
|
||||||
- container: "git.tesses.org/tesses50/linux-x86:latest"
|
- container: "git.tesses.org/tesses50/linux-x86:latest"
|
||||||
puter: "asrock"
|
puter: "msi-walmart"
|
||||||
nfpmName: "386"
|
nfpmName: "386"
|
||||||
debianName: "i386-linux-gnu"
|
debianName: "i386-linux-gnu"
|
||||||
- container: "git.tesses.org/tesses50/linux-arm:latest"
|
- container: "git.tesses.org/tesses50/linux-arm:latest"
|
||||||
puter: "fw13-ubuntu-latest"
|
puter: "msi-walmart"
|
||||||
nfpmName: "arm7"
|
nfpmName: "arm7"
|
||||||
debianName: "arm-linux-gnueabihf"
|
debianName: "arm-linux-gnueabihf"
|
||||||
- container: "git.tesses.org/tesses50/linux-arm64:latest"
|
- container: "git.tesses.org/tesses50/linux-arm64:latest"
|
||||||
puter: "msi-walmart"
|
puter: "asrock"
|
||||||
nfpmName: "arm64"
|
nfpmName: "arm64"
|
||||||
debianName: "aarch64-linux-gnu"
|
debianName: "aarch64-linux-gnu"
|
||||||
- container: "git.tesses.org/tesses50/linux-riscv64:latest"
|
- container: "git.tesses.org/tesses50/linux-riscv64:latest"
|
||||||
nfpmName: "riscv64"
|
nfpmName: "riscv64"
|
||||||
debianName: "riscv64-linux-gnu"
|
debianName: "riscv64-linux-gnu"
|
||||||
puter: "asrock"
|
puter: "msi-walmart"
|
||||||
runs-on: ${{ matrix.puter }}
|
runs-on: ${{ matrix.puter }}
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.container }}
|
image: ${{ matrix.container }}
|
||||||
@@ -62,30 +60,15 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: bash build-for-nfpm.sh ${{ matrix.nfpmName }} ${{ matrix.debianName }}
|
- run: bash build-for-nfpm.sh ${{ matrix.nfpmName }} ${{ matrix.debianName }}
|
||||||
- uses: akkuman/gitea-release-action@v1
|
- uses: akkuman/gitea-release-action@v1
|
||||||
env:
|
|
||||||
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
files: |-
|
files: |-
|
||||||
artifacts/**
|
artifacts/**
|
||||||
|
|
||||||
|
docker:
|
||||||
update-tap:
|
runs-on: asrock
|
||||||
runs-on: msi-walmart
|
|
||||||
container: git.tesses.org/tesses50/global-containers-mingw:latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: |
|
|
||||||
mkdir -p artifacts
|
|
||||||
env -C Packaging/Windows bash build.sh
|
|
||||||
- uses: akkuman/gitea-release-action@v1
|
|
||||||
env:
|
|
||||||
NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18
|
|
||||||
with:
|
|
||||||
prerelease: true
|
|
||||||
files: |-
|
|
||||||
artifacts/**
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
- name: Log in to registry
|
- name: Log in to registry
|
||||||
@@ -100,7 +83,14 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
file: ./Dockerfile
|
file: ./Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ env.GITEA_DOMAIN }}/${{ env.RESULT_IMAGE_NAME }}:latest
|
tags: |
|
||||||
|
${{ env.GITEA_DOMAIN }}/${{ env.RESULT_IMAGE_NAME }}:latest
|
||||||
|
${{ env.GITEA_DOMAIN }}/${{ env.RESULT_IMAGE_NAME }}:${{ env.VERSION }}
|
||||||
|
|
||||||
|
update-tap:
|
||||||
|
runs-on: r420
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: "master"
|
ref: "master"
|
||||||
@@ -114,4 +104,18 @@ jobs:
|
|||||||
git config user.email "noreply@tesses.net"
|
git config user.email "noreply@tesses.net"
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Push crosslang=${{ env.VERSION }}"
|
git commit -m "Push crosslang=${{ env.VERSION }}"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
|
windows:
|
||||||
|
runs-on: asrock
|
||||||
|
container: git.tesses.org/tesses50/global-containers-mingw:latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: |
|
||||||
|
mkdir -p artifacts
|
||||||
|
env -C Packaging/Windows bash build.sh
|
||||||
|
- uses: akkuman/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
prerelease: true
|
||||||
|
files: |-
|
||||||
|
artifacts/**
|
||||||
Vendored
-2
@@ -16,9 +16,7 @@
|
|||||||
"CROSSLANG_ENABLE_TERMIOS=1",
|
"CROSSLANG_ENABLE_TERMIOS=1",
|
||||||
"CROSSLANG_ENABLE_MBED=1",
|
"CROSSLANG_ENABLE_MBED=1",
|
||||||
"CROSSLANG_ENABLE_SQLITE=1",
|
"CROSSLANG_ENABLE_SQLITE=1",
|
||||||
"TESSESFRAMEWORK_ENABLE_SDL2=1",
|
|
||||||
"CROSSLANG_ENABLE_PROCESS=1",
|
"CROSSLANG_ENABLE_PROCESS=1",
|
||||||
"CROSSLANG_ENABLE_FFI=1",
|
|
||||||
"CROSSLANG_ENABLE_SHARED=1"
|
"CROSSLANG_ENABLE_SHARED=1"
|
||||||
],
|
],
|
||||||
"compilerPath": "/usr/bin/gcc",
|
"compilerPath": "/usr/bin/gcc",
|
||||||
|
|||||||
Vendored
+5
-3
@@ -8,8 +8,11 @@
|
|||||||
"name": "(gdb) Launch",
|
"name": "(gdb) Launch",
|
||||||
"type": "cppdbg",
|
"type": "cppdbg",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceFolder}/builds/l/crossint",
|
"program": "${workspaceFolder}/build/crosslang",
|
||||||
"args": ["queryable.tcross"],
|
"args": [
|
||||||
|
"webapp",
|
||||||
|
"tytd2025"
|
||||||
|
],
|
||||||
"stopAtEntry": false,
|
"stopAtEntry": false,
|
||||||
"cwd": "${workspaceFolder}/builds/l",
|
"cwd": "${workspaceFolder}/builds/l",
|
||||||
"environment": [],
|
"environment": [],
|
||||||
@@ -28,6 +31,5 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.0.13
|
||||||
|
Fix the event loop so it isn't 100% CPU utilization
|
||||||
|
|
||||||
|
## 0.0.12
|
||||||
|
Fix fetchcontent, add constant time compare for bytearray
|
||||||
|
|
||||||
## 0.0.11
|
## 0.0.11
|
||||||
Add htmlparser, conditional variables, make alloc_threshold overridable in prefs.json
|
Add htmlparser, conditional variables, make alloc_threshold overridable in prefs.json
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ set(CROSSLANG_STATIC ${TESSESFRAMEWORK_STATIC} CACHE INTERNAL "For CrossLang" FO
|
|||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
TessesFramework
|
TessesFramework
|
||||||
GIT_REPOSITORY https://git.tesses.org/tesses50/tessesframework.git
|
GIT_REPOSITORY https://git.tesses.org/tesses50/tessesframework.git
|
||||||
GIT_TAG e4ca34aa597c9b0955aa23c18c500048af697c92
|
GIT_TAG 7649a1ad4c4fc230c96bcf044fd36f6cef1671be
|
||||||
)
|
)
|
||||||
set(TESSESFRAMEWORK_ENABLE_EXAMPLES OFF)
|
set(TESSESFRAMEWORK_ENABLE_EXAMPLES OFF)
|
||||||
FetchContent_MakeAvailable(TessesFramework)
|
FetchContent_MakeAvailable(TessesFramework)
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ target_include_directories(crosslang
|
|||||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(TESSESFRAMEWORK_FETCHCONTENT)
|
if(CROSSLANG_FETCHCONTENT)
|
||||||
target_link_libraries(crosslang PUBLIC tessesframework)
|
target_link_libraries(crosslang PUBLIC tessesframework)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(crosslang PUBLIC TessesFramework::tessesframework)
|
target_link_libraries(crosslang PUBLIC TessesFramework::tessesframework)
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
set(CROSSLANG_MAJOR_VERSION 0)
|
set(CROSSLANG_MAJOR_VERSION 0)
|
||||||
set(CROSSLANG_MINOR_VERSION 0)
|
set(CROSSLANG_MINOR_VERSION 0)
|
||||||
set(CROSSLANG_PATCH_VERSION 11)
|
set(CROSSLANG_PATCH_VERSION 13)
|
||||||
|
|||||||
@@ -22,6 +22,16 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
namespace Tesses::CrossLang {
|
namespace Tesses::CrossLang {
|
||||||
|
AdvancedSyntaxNode AdvancedSyntaxNode::Create(std::string_view nodeName,
|
||||||
|
bool isExpression,
|
||||||
|
std::vector<SyntaxNode> nodes) {
|
||||||
|
AdvancedSyntaxNode asn;
|
||||||
|
asn.nodeName = std::string(nodeName);
|
||||||
|
asn.isExpression = isExpression;
|
||||||
|
asn.nodes = nodes;
|
||||||
|
return asn;
|
||||||
|
}
|
||||||
|
|
||||||
SyntaxNode TObject2SyntaxNode(TObject o) {
|
SyntaxNode TObject2SyntaxNode(TObject o) {
|
||||||
if (std::holds_alternative<Undefined>(o))
|
if (std::holds_alternative<Undefined>(o))
|
||||||
return Undefined();
|
return Undefined();
|
||||||
|
|||||||
@@ -100,6 +100,15 @@ static TObject Crypto_Base64Decode(GCList &ls, std::vector<TObject> args) {
|
|||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
static TObject Crypto_ConstantEquals(GCList &ls, std::vector<TObject> args) {
|
||||||
|
TByteArray *left;
|
||||||
|
TByteArray *right;
|
||||||
|
if (GetArgumentHeap(args, 0, left) && GetArgumentHeap(args, 1, right)) {
|
||||||
|
return Tesses::Framework::Crypto::ConstantEquals(left->data,
|
||||||
|
right->data);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
void TStd::RegisterCrypto(std::shared_ptr<GC> gc, TRootEnvironment *env) {
|
void TStd::RegisterCrypto(std::shared_ptr<GC> gc, TRootEnvironment *env) {
|
||||||
|
|
||||||
env->permissions.canRegisterCrypto = true;
|
env->permissions.canRegisterCrypto = true;
|
||||||
@@ -110,6 +119,9 @@ void TStd::RegisterCrypto(std::shared_ptr<GC> gc, TRootEnvironment *env) {
|
|||||||
dict->DeclareFunction(gc, "PBKDF2", "Hash passwords with PBKDF2",
|
dict->DeclareFunction(gc, "PBKDF2", "Hash passwords with PBKDF2",
|
||||||
{"pass", "salt", "itterations", "keylen", "shanum"},
|
{"pass", "salt", "itterations", "keylen", "shanum"},
|
||||||
Crypto_PBKDF2);
|
Crypto_PBKDF2);
|
||||||
|
dict->DeclareFunction(gc, "ConstantEquals",
|
||||||
|
"Compare two byte arrays using constant time",
|
||||||
|
{"array1", "array2"}, Crypto_ConstantEquals);
|
||||||
dict->DeclareFunction(gc, "RandomBytes",
|
dict->DeclareFunction(gc, "RandomBytes",
|
||||||
"Create bytearray but with random bytes in it "
|
"Create bytearray but with random bytes in it "
|
||||||
"instead of zeros (this uses mbedtls by the way)",
|
"instead of zeros (this uses mbedtls by the way)",
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
/*
|
||||||
|
CrossLang is a dynamically-typed scripting language built on
|
||||||
|
TessesFramework, named in honor of Jesus's sacrifice.
|
||||||
|
|
||||||
|
Copyright (C) 2026 Mike Nolan
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later WITH TessesFramework-Exception-1.0
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
#include "CrossLang.hpp"
|
#include "CrossLang.hpp"
|
||||||
|
|
||||||
namespace Tesses::CrossLang {
|
namespace Tesses::CrossLang {
|
||||||
|
|||||||
+6
-1
@@ -179,6 +179,8 @@ void GC::BarrierEnd() { this->mtx.Unlock(); }
|
|||||||
void GC::Watch(TObject obj) {
|
void GC::Watch(TObject obj) {
|
||||||
if (std::holds_alternative<THeapObject *>(obj)) {
|
if (std::holds_alternative<THeapObject *>(obj)) {
|
||||||
auto _item = std::get<THeapObject *>(obj);
|
auto _item = std::get<THeapObject *>(obj);
|
||||||
|
if (_item == nullptr)
|
||||||
|
return;
|
||||||
this->BarrierBegin();
|
this->BarrierBegin();
|
||||||
this->objects.insert(_item);
|
this->objects.insert(_item);
|
||||||
auto nowAllocs = ++this->allocs;
|
auto nowAllocs = ++this->allocs;
|
||||||
@@ -190,12 +192,15 @@ void GC::Watch(TObject obj) {
|
|||||||
void GC::Mark(TObject obj) {
|
void GC::Mark(TObject obj) {
|
||||||
if (std::holds_alternative<THeapObject *>(obj)) {
|
if (std::holds_alternative<THeapObject *>(obj)) {
|
||||||
auto _item = std::get<THeapObject *>(obj);
|
auto _item = std::get<THeapObject *>(obj);
|
||||||
_item->Mark();
|
if (_item)
|
||||||
|
_item->Mark();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void GC::Unwatch(TObject obj) {
|
void GC::Unwatch(TObject obj) {
|
||||||
if (std::holds_alternative<THeapObject *>(obj)) {
|
if (std::holds_alternative<THeapObject *>(obj)) {
|
||||||
auto _item = std::get<THeapObject *>(obj);
|
auto _item = std::get<THeapObject *>(obj);
|
||||||
|
if (_item == nullptr)
|
||||||
|
return;
|
||||||
this->BarrierBegin();
|
this->BarrierBegin();
|
||||||
this->objects.erase(_item);
|
this->objects.erase(_item);
|
||||||
this->BarrierEnd();
|
this->BarrierEnd();
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ std::shared_ptr<GC> GCList::GetGC() const { return this->gc; }
|
|||||||
void GCList::Remove(TObject obj) {
|
void GCList::Remove(TObject obj) {
|
||||||
if (std::holds_alternative<THeapObject *>(obj)) {
|
if (std::holds_alternative<THeapObject *>(obj)) {
|
||||||
auto _item = std::get<THeapObject *>(obj);
|
auto _item = std::get<THeapObject *>(obj);
|
||||||
|
if (_item == nullptr)
|
||||||
|
return;
|
||||||
this->gc->BarrierBegin();
|
this->gc->BarrierBegin();
|
||||||
for (auto index = this->items.begin(); index != this->items.end();
|
for (auto index = this->items.begin(); index != this->items.end();
|
||||||
index++) {
|
index++) {
|
||||||
@@ -47,6 +49,8 @@ void GCList::Add(TObject obj) {
|
|||||||
|
|
||||||
if (std::holds_alternative<THeapObject *>(obj)) {
|
if (std::holds_alternative<THeapObject *>(obj)) {
|
||||||
auto _item = std::get<THeapObject *>(obj);
|
auto _item = std::get<THeapObject *>(obj);
|
||||||
|
if (_item == nullptr)
|
||||||
|
return;
|
||||||
this->gc->BarrierBegin();
|
this->gc->BarrierBegin();
|
||||||
|
|
||||||
for (auto item : this->items) {
|
for (auto item : this->items) {
|
||||||
|
|||||||
Reference in New Issue
Block a user