
I am trying to compile the swig simple example for racket https://github.com/swig/swig/tree/master/Examples/mzscheme/simple Can anyone verify that it works ? It doesn seem to be compatible with latest bc racket

Maybe @ryanc has tried recently?

I really don’t want to switch to python :confused: :confused:

I haven’t tried the mzscheme plugin, but I’m working on a new plugin that generates Racket code (ffi/unsafe): https://github.com/rmculpepper/swig. (I guess @soegaard2 saw the fork?) Draft docs are in racket.md in the main directory for now; I haven’t converted them to HTML yet.

Hi All,
I need an extra pair of eyes to solve this problem. I am attempting to make Github Actions build my code each time I push to racket-cas. The build starts fine, but I am getting errors like: raco setup: --- summary of package problems --- [13:38:16]
raco setup: undeclared dependency detected
raco setup: for package: "racket-cas"
raco setup: on packages:
raco setup: "base"
raco setup: "math-lib"
raco setup: "rackunit-lib"
raco setup: "scribble-lib"
raco setup: on package for build:
raco setup: "at-exp-lib"
Error: Process completed with exit code 1.
So … I add these to the info files, but it doesn’t seem to help. Obviously, I am missing something, but what?
The log file: https://github.com/soegaard/racket-cas/runs/3496243356?check_suite_focus=true The repo: https://github.com/soegaard/racket-cas

Maybe I’m wrong — hardly a raco expert — but is the error saying that it’s your package that has the missing deps or “at-exp-lib” (in racket-cas-doc as a dep) that has the issues?

I believe so. The snippet above is the summary. Above the summary, there are loads of messages like: raco setup: found undeclared dependency:
raco setup: mode: run
raco setup: for package: "racket-cas"
raco setup: on package: core
raco setup: dependent source: /home/runner/work/racket-cas/racket-cas/racket-cas/compiled/trig-expand_rkt.zo
raco setup: used module: (lib "racket/syntax.rkt")

I usually have raco pkg install --deps search-auto
to install my own package and then raco test ___
to run tests. I’m not sure about your 3 separate raco pkg install
steps (and their flags) followed by a raco setup
? Maybe that’s trying to do something special I haven’t had to deal with, but, maybe that’s also contributing to the problem you’re seeing??

(With raco pkg install --deps search-auto
, if I’ve ever gotten deps warnings, they’ve been genuine problems and fixed by updating my info.rkt
.)

- name: Register local packages
run: \|
cd ../..
raco pkg install -i --auto --no-setup --skip-installed rackunit-lib
raco pkg install -i --auto --no-setup --skip-installed racket-cas/
raco pkg update --auto --no-setup racket-cas
cd racket-cas
- name: Setup Collections
run: raco setup --check-pkg-deps racket-cas
I simply copied the approach from one of my other packages. And now I can’t remember why I did it that way. I’ll try --deps search-auto
.
I think, manually installing the packages can make the build step succeed without correct info files (in some cases) - maybe?.

It’s worth noting that racket-cas
isn’t on the package server.

FWIW I usually have a Makefile
with targets for use locally, or for use by CI, or both. For example: https://github.com/greghendershott/sha/blob/master/Makefile

And then the GitHub Actions use of it is effectively just make install && make check-deps && make test
. For example: https://github.com/greghendershott/sha/blob/master/.github/workflows/test.yml#L27-L32

(For raco pkg
etc. sometimes I use command-line flags that are from older versions of Racket. Because I set it up then. And for some packages, I want them to keep working on older Rackets. So… there might be newer more-concise variations of these if you only care about newer Rackets, idk.)

Thanks for sharing these.

I think, it is working now. Thanks for the pointers.

wait, so with this: https://pkgs.racket-lang.org/package/c #lang c
in main() {}
you can write C code?! what compiler does it use?

It uses the cc
program, which could be aliased to either gcc
or clang
or other compilers

Whatever c++ compiler that is in your path https://github.com/jeapostrophe/c/blob/master/c/lang/runtime.rkt\|https://github.com/jeapostrophe/c/blob/master/c/lang/runtime.rkt

guessing on windows it would use msvc? that’s pretty neat

is there a high cost to calling out to FFI ?

is there a program that auto-generates ffi bindings for racket based on a C header file? something akin to bindgen on rust?


As far as I know, that library works for Racket BC

works only for BC ? not CS?

yeah

awwww

There is this, but no idea how ready for use it is: https://racket.slack.com/archives/C06V96CKX/p1630584729174800?thread_ts=1630578896.173500&cid=C06V96CKX

@ryanc tell us when its ready to use!

Apropos previous discussion on Github Actions: A tool for running the actions locally (to get faster feedback) https://github.com/nektos/act

Is there a Racket function that turns an absolute path into a relative path (given a path it should be relative to)?


e.g. (find-relative-path (build-path "a" "b" "c" "file.txt") (build-path "a" "b")) -> #<path:c/file.txt>

(in my scenario the first path is coming from glob
so is absolute and constructed according to an arbitrary glob)

That’s the one, thanks!

does BSL or any of the later variants provide a way to enforce the type signatures opposed to them just being comments?

In ASL, there’s a :
form that allows you to check against a signature

E.g.,
(: x Integer)
(define x "a")

ahh there we go, i was watching a talk about htdp taught by someone in germany i think and was wondering when that was introduced

so that’s only introduced in ASL? its stated in the book too ?

Correction: the “Available from Catalog” has a list of packages that can be selected

Germany! Could be a different language. But I can’t read German :disappointed: https://www.deinprogramm.de/ and https://github.com/racket/deinprogramm

I believe the deinprogramm-signature
package does some signature checking

that doesnt come built in with racket though? hmm.. i guess i can jump to ASL pretty soon

It does. It is in the main distribution. The DeinProgramm plugins are also loaded by default.

It is in German. Not sure if it’s what you saw

how do i add it in BSL? (require deinprogramm-signature)
?

ahh.. if the error messages are in german then i think i might avoid it for ASL instead

Sorry, my words are confusing. I mean it’s for a different teaching language…

ohhhhh, yeah.. nevermind then

Is there an idiomatic way to put context information on a list-ish syntax object? That is, instead of #'(A B C)
, having something like (datum->syntax this-syntax (list #'A #'B #'C))
A related question: is there an idiomatic way to place source location on forms nested inside a syntax template, without having to introduce an extra pattern variable?

does racket doesnt have support for algebraic types in #lang racket ? or do you need a package for it?

@jestarray perhaps you might be interested in https://pkgs.racket-lang.org/package/algebraic