Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proof of concept of package manager #296

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
44944e7
add more time primitives
mattwparas Nov 24, 2024
1ef17b6
package manager
mattwparas Nov 28, 2024
b9a7e8a
fix build
mattwparas Nov 28, 2024
6e306b2
more progress
mattwparas Dec 1, 2024
86058ea
clean up
mattwparas Dec 1, 2024
84411c5
include forge file
mattwparas Dec 1, 2024
3f537f2
start using libgit2
mattwparas Dec 2, 2024
2e94449
more stuff
mattwparas Dec 2, 2024
e278515
remove from the base instructions
mattwparas Dec 2, 2024
39c2203
fix warnings
mattwparas Dec 2, 2024
15b5fdb
more stuff
mattwparas Dec 3, 2024
0b881cc
fix up toml library
mattwparas Dec 3, 2024
80b14e8
add handling for hashing ffi values
mattwparas Dec 3, 2024
fb3a959
more stuff
mattwparas Dec 4, 2024
f5d93ed
support for forcibly installing
mattwparas Dec 5, 2024
6bf0959
clean up installation
mattwparas Dec 5, 2024
b325efb
vendor openssl
mattwparas Dec 5, 2024
f3a9edd
allow non local definitions
mattwparas Dec 6, 2024
d4feb5c
add which to xtask
mattwparas Dec 6, 2024
3e4d614
re implement keyword args
mattwparas Dec 11, 2024
f991828
more fixes
mattwparas Dec 12, 2024
135a735
better formatting for pkg list
mattwparas Dec 12, 2024
038d02e
fix windows build
mattwparas Dec 12, 2024
e0d9a08
fix build
mattwparas Dec 12, 2024
5e289d7
fixing tail call handling with multi arity functions
mattwparas Dec 13, 2024
7202718
more optional arg stuff
mattwparas Dec 13, 2024
7220d28
fix arity handling
mattwparas Dec 13, 2024
54ff194
attempt to fix windows build
mattwparas Dec 13, 2024
6e22ee1
add some plumbing for syntax-case
mattwparas Dec 14, 2024
7ce7857
some baby steps towards syntax-case
mattwparas Dec 17, 2024
5ebd99b
even more syntax-case plumbing
mattwparas Dec 17, 2024
950264d
more plumbing
mattwparas Dec 17, 2024
e31cb57
fix the expansion
mattwparas Dec 19, 2024
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
5 changes: 3 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,11 @@ jobs:
- name: Build
run: cargo build --verbose

- name: install steel dylib installer
- name: Install steel dylib installer and package manager
env:
STEEL_HOME: ${{ env.STEEL_HOME }}
run: mkdir -p $STEEL_HOME/native && cd crates/cargo-steel-lib && cargo install --path .
# run: mkdir -p $STEEL_HOME/native && cd crates/cargo-steel-lib && cargo install --path .
run: cargo install --path crates/cargo-steel-lib && cargo install --path crates/forge

- name: Install cogs
env:
Expand Down
124 changes: 113 additions & 11 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/mattwparas/steel"
description = "Steel repl and command line interface"
default-run = "steel"

include = ["/src/**/*", "/Cargo.toml", "/README.md", "LICENSE*"]

[workspace.package]
version = "0.6.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "steel"
path = "src/main.rs"
Expand All @@ -22,7 +22,9 @@ path = "src/main.rs"
steel-core = { path = "./crates/steel-core", version = "0.6.0", features = ["dylibs", "markdown", "stacker", "sync"] }

[features]
default = ["mimalloc"]
build-info = ["vergen"]
mimalloc = ["dep:mimalloc"]
# Note: It does not appear that this will get propagated to any crate that depends on
# the workspace feature. This is unfortunate, since we'd like everything to actually
# use the workspace dependency. For now, if you want to test with sync, you should
Expand All @@ -39,6 +41,7 @@ env_logger = "0.10.0"
log = "0.4.17"
clap = { version = "=4.1.4", features = ["derive"] }
steel-doc = { path = "./crates/steel-doc", version = "0.6.0" }
mimalloc = { version = "0.1.43", optional = true }

[target.'cfg(not(target_os = "redox"))'.dependencies]
cargo-steel-lib = { path = "./crates/cargo-steel-lib", version = "0.1.0" }
Expand All @@ -55,7 +58,7 @@ members = [
]

[profile.release]
debug = false
debug = true
lto = true

[profile.test]
Expand Down
9 changes: 8 additions & 1 deletion benchmarks/bench.scm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
(define (run-bench args)
(~> (command "hyperfine" args) (spawn-process) (Ok->value) (wait)))

(define *interpreter-map* (hash "py" "python3.10" "scm" "../target/release/steel" "lua" "lua"))
(define *interpreter-map*
(hash "py"
"python3.13"
;; "scm" "../target/release/steel"
"scm"
"../target/aarch64-apple-darwin/release/steel"
"lua"
"lua"))

(define (extension->interpreter ext)
(hash-get *interpreter-map* ext))
Expand Down
9 changes: 5 additions & 4 deletions benchmarks/bin-trees/bin-trees.scm
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
(node #f val #f))
(define (leaf? l)
(not (node-left l)))
(define (leaf-val l)
node-val)

(define (make item d)
(if (= d 0)
(leaf item)
(let ([item2 (* item 2)] [d2 (- d 1)]) (node (make (- item2 1) d2) item (make item2 d2)))))
(let ([item2 (* item 2)]
[d2 (- d 1)])
(node (make (- item2 1) d2) item (make item2 d2)))))

(define (check t)
(if (leaf? t) 1 (+ 1 (+ (check (node-left t)) (check (node-right t))))))
Expand All @@ -42,7 +42,8 @@
(loop (+ 2 d) end max-depth min-depth))))

(define (main n)
(let* ([min-depth 4] [max-depth (max (+ min-depth 2) n)])
(let* ([min-depth 4]
[max-depth (max (+ min-depth 2) n)])
(let ([stretch-depth (+ max-depth 1)])
(displayln "stretch tree of depth " stretch-depth " check: " (check (make 0 stretch-depth))))
(let ([long-lived-tree (make 0 max-depth)])
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/fib/fib.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(define (fib n)
(if (<= n 2) 1 (+ (fib (- n 1)) (fib (- n 2)))))

(fib 40)
(fib 28)
16 changes: 16 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
#[cfg(feature = "build-info")]
{
use vergen::{BuildBuilder, CargoBuilder, Emitter, RustcBuilder};
let build = BuildBuilder::all_build()?;
let cargo = CargoBuilder::all_cargo()?;
let rustc = RustcBuilder::all_rustc()?;

Emitter::default()
.add_instructions(&build)?
.add_instructions(&cargo)?
.add_instructions(&rustc)?
.emit()?;
}
Ok(())
}
2 changes: 1 addition & 1 deletion cogs/command-line/args.scm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[(empty? arg-list)
;; Check that the positionl args have been fulfilled
(when (not (= (length (ArgumentParserSpec-positional-args spec)) (length positional-args)))
(displayln "getting here")
; (displayln "getting here")
(error "Missing positional arguments: "
(drop (ArgumentParserSpec-positional-args spec) (length positional-args))))

Expand Down
2 changes: 1 addition & 1 deletion cogs/fs/cog.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
(define version "0.1.0")

;; Core library, requires no dependencies
(define dependencies '())
(define dependencies '())
Loading
Loading