Skip to content

Commit

Permalink
0.9.502
Browse files Browse the repository at this point in the history
- More WASM fixes
  • Loading branch information
RobbyV2 committed Nov 27, 2024
1 parent 967c1a9 commit 4ef4039
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 18 deletions.
48 changes: 41 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,37 @@ jobs:
if: matrix.target == 'wasm32-unknown-unknown'
run: |
cargo build --release --target wasm32-unknown-unknown --features wasm
mkdir -p release/wasm/raw
cp target/wasm32-unknown-unknown/release/fplc.wasm release/wasm/raw/
mkdir -p release
cp target/wasm32-unknown-unknown/release/fplc.wasm release/fplc-raw.wasm
- name: Build WASM (Bindgen)
if: matrix.target == 'wasm32-unknown-unknown'
run: |
wasm-pack build --target web --release -- --features "wasm bindgen"
mkdir -p release/wasm/bindgen
cp pkg/* release/wasm/bindgen/
mkdir -p release/wasm-bindgen
cp pkg/fplc_bg.wasm release/wasm-bindgen/
cp pkg/fplc.js release/wasm-bindgen/
cp pkg/fplc.d.ts release/wasm-bindgen/
cp pkg/fplc_bg.wasm.d.ts release/wasm-bindgen/
cd release && zip -r wasm-bindgen.zip wasm-bindgen/
- name: Upload Raw WASM Artifact
if: matrix.target == 'wasm32-unknown-unknown'
uses: actions/upload-artifact@v4
with:
name: pseudolang-raw-wasm
path: release/fplc-raw.wasm
retention-days: 7
if-no-files-found: error

- name: Upload Bindgen WASM Artifact
if: matrix.target == 'wasm32-unknown-unknown'
uses: actions/upload-artifact@v4
with:
name: pseudolang-wasm-bindgen
path: release/wasm-bindgen.zip
retention-days: 7
if-no-files-found: error

- name: Build Native
if: ${{ !contains(matrix.target, 'wasm') }}
Expand Down Expand Up @@ -198,15 +220,27 @@ jobs:
name: pseudolang-wasm32-unknown-unknown
path: artifacts/wasm

- name: Download Raw WASM Artifacts
uses: actions/download-artifact@v4
with:
name: pseudolang-raw-wasm
path: artifacts/wasm-raw

- name: Download Bindgen WASM Artifacts
uses: actions/download-artifact@v4
with:
name: pseudolang-wasm-bindgen
path: artifacts/wasm-bindgen

- name: Prepare Release Files
run: |
mkdir -p release
cp artifacts/windows/fplc-x64.exe release/
cp artifacts/windows/pseudolang-setup-x64.exe release/ || true
cp artifacts/linux/fplc-linux-x64 release/
cp artifacts/wasi/wasi/fplc.wasm release/fplc-wasi.wasm || true
cp artifacts/wasm/wasm/raw/fplc.wasm release/fplc-raw.wasm || true
cp -r artifacts/wasm/wasm/bindgen/* release/bindgen/ || true
cp artifacts/wasm-raw/fplc-raw.wasm release/ || true
cp artifacts/wasm-bindgen/wasm-bindgen.zip release/ || true
chmod +x release/fplc-linux-x64
- name: Create Release and Upload Assets
Expand All @@ -225,4 +259,4 @@ jobs:
release/pseudolang-setup-x64.exe
release/fplc-wasi.wasm
release/fplc-raw.wasm
release/bindgen/*
release/wasm-bindgen.zip
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[package]
name = "fplc"
version = "0.9.501"
version = "0.9.502"
edition = "2021"
description = "A pseudolang interpreter written in Rust"
repository = "https://github.com/PseudoLang-Software-Foundation/Pseudolang"
Expand Down
4 changes: 2 additions & 2 deletions installer/pseudolang.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

!define MUI_ICON "Pseudolang-Logo.ico"

Name "PseudoLang Installer v0.9.501"
Name "PseudoLang Installer v0.9.502"
InstallDir "$PROGRAMFILES\PseudoLang\"
OutFile "../release/installer/pseudolang-setup-x64.exe"
BrandingText "(c) 2024 PseudoLang Software Foundation"
Expand Down Expand Up @@ -33,7 +33,7 @@ Section ""
WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$INSTDIR;$R0"

WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayName" "Pseudolang"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayVersion" "0.9.501"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayVersion" "0.9.502"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "Publisher" "Pseudolang Software Foundation"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Pseudolang" "DisplayIcon" "$INSTDIR\Pseudolang-Logo.ico"

Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<div align="center">
<p>
<img src="https://github.com/PseudoLang-Software-Foundation/Pseudolang/actions/workflows/build.yml/badge.svg" alt="Build and Test Pseudolang">
<img src="https://img.shields.io/badge/Version-0.9.501-green" alt="Version">
<img src="https://img.shields.io/badge/Version-0.9.502-green" alt="Version">
<a href="https://nightly.link/PseudoLang-Software-Foundation/Pseudolang/workflows/build/main"><img src="https://img.shields.io/badge/Nightly-Releases-purple" alt="Nightly Releases"></a>
</p>
</div>

Welcome to Pseudolang! Pseudolang is a simple programming language written in Rust, inspired by College Board's Pseudocode.

This project aims to fully support Windows and Linux.
This project aims to fully support 64-bit Windows, Linux, and WebAssembly (WASI Package, Raw WASM).

## Releases

Expand Down
8 changes: 4 additions & 4 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use crate::core::execute_code;

#[cfg(all(target_arch = "wasm32", not(feature = "wasi")))]
#[no_mangle]
pub extern "C" fn run_pseudolang_raw(ptr: *const u8, len: usize) -> u64 {
pub extern "C" fn run_pseudolang_raw(ptr: *const u8, len: usize, debug: bool) -> u64 {
let input = unsafe {
let slice = std::slice::from_raw_parts(ptr, len);
std::str::from_utf8_unchecked(slice)
};

match execute_code(input, false, true) {
match execute_code(input, debug, true) {
Ok(output) => {
let bytes = output.into_bytes();
let ptr = bytes.as_ptr() as u64;
Expand All @@ -26,9 +26,9 @@ use wasm_bindgen::prelude::*;

#[cfg(all(target_arch = "wasm32", not(feature = "wasi")))]
#[wasm_bindgen]
pub fn run_pseudolang(input: &str) -> Result<String, JsValue> {
pub fn run_pseudolang(input: &str, debug: bool) -> Result<String, JsValue> {
console_error_panic_hook::set_once();
execute_code(input, false, true).map_err(|e| JsValue::from_str(&e))
execute_code(input, debug, true).map_err(|e| JsValue::from_str(&e))
}

#[cfg(all(target_arch = "wasm32", not(feature = "wasi")))]
Expand Down
2 changes: 1 addition & 1 deletion wapm.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[package]
name = "pseudolang/fplc"
version = "0.9.501"
version = "0.9.502"
description = "A pseudolang interpreter written in Rust"
license = "MIT"
readme = "readme.md"
Expand Down

0 comments on commit 4ef4039

Please sign in to comment.