[racket-users] Why are these @defthing blocks typeset incorrectly?

2020-09-23 Thread Sage Gerard
I attached an image showing the rendered output of 
https://github.com/zyrolasting/xiden/blob/master/docs/reference/settings.scrbl#L48

I create an application to `(defthing)` as a datum due to circumstances in the 
surrounding code. The hacky part being `get-contract-datum`, which tries to 
produce a datum usable as a contract expression. I'm assuming that this leaves 
no whitespace to preserve, so how do I modify a syntax object to include space 
in desired spots?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/ulye9ZNaZmcspsE7fqy6ctobuGcF21jQvGQ4-PG2Eynt09KBU9AbF_kP9UZ_OgouhcvBOF8JLbaCJpVbnve-6RF_E752tVqp-xR9Va3oRsE%3D%40sagegerard.com.


[racket-users] Security: #%top-interaction in setup/infotab?

2020-09-23 Thread Sage Gerard
Is there a security reason behind omitting #%top-interaction from 
`setup/infotab`?
~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/Yoaut6s1RsiDXyNqflAqyoy_rAX7Q_vt4TU0m9eP14jCEl3shHSmT3VYCbWFMntp7GntskcovBl6djjGI1_0J1xzMuNTOZ9l8WAdXoGSuVw%3D%40sagegerard.com.


Re: [racket-users] Writing make-sized-byte-string alternative on CS

2020-09-15 Thread Sage Gerard
Thank you for the rapid response!


~slg

‐‐‐ Original Message ‐‐‐
On Tuesday, September 15, 2020 5:15 PM, Matthew Flatt  
wrote:

> You use `make-bytes` and `memcpy`, instead of writing a new loop. (The
> non-copying part of `make-sized-byte-string` is what CS can't support.)
>
> Matthew
>
> At Tue, 15 Sep 2020 21:12:22 +, Sage Gerard wrote:
>
> > The docs for
> > [make-sized-byte-string](https://docs.racket-lang.org/foreign/foreign_pointer-f
> > uncs.html?q=free#%28def.%28%28quote.~23~25foreign%29._make-sized-byte-string%
> > 29%29) indicate that CS does not support this operation. I'm guessing I just
> > need to fall back to building a loop using ptr-ref, but is there something
> > about CS that would prevent me from doing that too?
> > ~slg
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/P-nFrHLWq2Hs3MxhcsA09NoQtGaw0LfG
> > 5WE-nC_IHWGSl3rPhToCquz8spEVDUAqg-LJRYweeGmerH12XTUUFhXBOHgBDAabpQk-2b2gFiQ%3D%
> > 40sagegerard.com.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200915151528.252%40sirmail.smtps.cs.utah.edu.


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/VaJJK7oIA61OCcSOlP_cUnN2A9AemVTtzbPbFw8A_Z0zT7zwzqAg19rTT7NOiCGtTU1OnfLDjXOLlXPxxeoV1-Ikjnm3PBrcjvOgHeXiea8%3D%40sagegerard.com.


[racket-users] Writing make-sized-byte-string alternative on CS

2020-09-15 Thread Sage Gerard
The docs for 
[make-sized-byte-string](https://docs.racket-lang.org/foreign/foreign_pointer-funcs.html?q=free#%28def._%28%28quote._~23~25foreign%29._make-sized-byte-string%29%29)
 indicate that CS does not support this operation. I'm guessing I just need to 
fall back to building a loop using ptr-ref, but is there something about CS 
that would prevent me from doing that too?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/P-nFrHLWq2Hs3MxhcsA09NoQtGaw0LfG5WE-nC_IHWGSl3rPhToCquz8spEVDUAqg-LJRYweeGmerH12XTUUFhXBOHgBDAabpQk-2b2gFiQ%3D%40sagegerard.com.


[racket-users] -i as an identifier

2020-09-10 Thread Sage Gerard
It looks like -i cannot be used as an identifier because it evaluates to the 
complex number 0-1i. So in the v7.8 REPL, (define -i "foo") fails. I noticed 
this when trying to map CLI flag strings to identifiers. -i was the only one in 
the set to fall over.

In the Reading Numbers section of the reference, it looks like a digit sequence 
is required before "i" for both the inexact complex and exact complex 
productions. That makes sense to me because it doesn't seem right to assume 
that an empty string corresponds to -1 like it seems to do here. Maybe I'm 
misreading the grammar?

Before I open a GitHub issue, I just need to know if any part of this is 
unintentional.

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/s9pqyR4hlcTjjfYYHeNqnVsDKbU138qdy-L0rIquew86_TtTNX4SlRRw2r4Yv2-0szTzJiCmyu4QDmwwfPD863HHRO6oZpT9x1V8GfCmM3E%3D%40sagegerard.com.


Re: [racket-users] Making expanded bindings visible in top-level

2020-09-07 Thread Sage Gerard
Ah, thank you. I didn't think that the original syntax object would have the 
lexical information I needed. For some reason I thought about constructing a 
syntax object using the name pattern variables and using that instead.

~slg

‐‐‐ Original Message ‐‐‐
On Sunday, September 6, 2020 10:15 PM, Sorawee Porncharoenwase 
 wrote:

> I think it’s only enough to fabricate the #%info-* identifiers. For example, 
> in the file you linked above, you can add:
>
> [#%info-domain (datum->syntax stx '#%info-domain)]
>
> to with-syntax, and provided that you provide #%top-interaction, you should 
> be able to use #%info-domain in the REPL.
>
> On Sun, Sep 6, 2020 at 5:53 PM Sage Gerard  wrote:
>
>> I'm writing a variant of 
>> [setup/infotab](https://github.com/racket/racket/blob/master/racket/collects/setup/infotab.rkt)
>>  to allow `#%top-interaction' plus some other bindings of my choice. But 
>> when I create a evaluator in the context of such a module, `#%info-domain' 
>> and `#%info-lookup' are not bound. I'd like to use a REPL to access these 
>> procedures.
>>
>> Is there a cleaner way to make the #%info-* procedures use the same lexical 
>> context without forcing each through syntax->datum and datum->syntax?
>>
>> ~slg
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/racket-users/HXI6OiTdOS3GiXhHp6tG2xC6vTPzNPublNDjosc_vQfNDtIrU1XjmheFOPoQLGQ4rmzmgOzbkRMJ-p1FvZngtIjLU-JAfVKHS0ZE6_wUstc%3D%40sagegerard.com](https://groups.google.com/d/msgid/racket-users/HXI6OiTdOS3GiXhHp6tG2xC6vTPzNPublNDjosc_vQfNDtIrU1XjmheFOPoQLGQ4rmzmgOzbkRMJ-p1FvZngtIjLU-JAfVKHS0ZE6_wUstc%3D%40sagegerard.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/JGVmzNf2epGhOGb3lynjl-cS0FqSSKAWL7Isqx9zwgIVAf578YevT-eJLfGCzBMOrSfRYAj0xt9cv01qp-lyYrcYHXlenfrfC4OFae3q6fU%3D%40sagegerard.com.


[racket-users] Making expanded bindings visible in top-level

2020-09-06 Thread Sage Gerard
I'm writing a variant of 
[setup/infotab](https://github.com/racket/racket/blob/master/racket/collects/setup/infotab.rkt)
 to allow `#%top-interaction' plus some other bindings of my choice. But when I 
create a evaluator in the context of such a module, `#%info-domain' and 
`#%info-lookup' are not bound. I'd like to use a REPL to access these 
procedures.

Is there a cleaner way to make the #%info-* procedures use the same lexical 
context without forcing each through syntax->datum and datum->syntax?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/HXI6OiTdOS3GiXhHp6tG2xC6vTPzNPublNDjosc_vQfNDtIrU1XjmheFOPoQLGQ4rmzmgOzbkRMJ-p1FvZngtIjLU-JAfVKHS0ZE6_wUstc%3D%40sagegerard.com.


Re: [racket-users] Can OpenSSL be upgraded for the next Racket release?

2020-08-18 Thread Sage Gerard
Thank you for this. This is such a helpful change!

 Original Message 
On Aug 18, 2020, 7:42 PM, Matthew Flatt wrote:

> Yes --- done.
>
> Matthew
>
> At Mon, 17 Aug 2020 17:46:49 +0100, Andre Garzia wrote:
>> Hi Folks,
>>
>> The OpenSSL DLLs being shipped with Racket (in version 7.7 at least) is
>> v1.1.0.8 which has already been EOLd. Version 1.1.1 is the stable version.
>> Version 1.1.1 is LTS and supported until 2023. In theory 1.1.1 is a drop-in
>> replacement for 1.1.0.8 since it is ABI and binary compatible with the
>> older version. Having that version available would allow us to benefit from
>> TLSv1.3:
>>
>> https://wiki.openssl.org/index.php/TLS1.3
>>
>> And also benefit from many other bug fixes.
>>
>> Best
>> Andre
>>
>>
>>
>> --
>> https://www.andregarzia.com 
>> Want to support me? Buy me a coffee at https://ko-fi.com/andregarzia
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200818174217.ea%40sirmail.smtps.cs.utah.edu.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/XVeMpeIHf5m-8ctp-tiRg_Mkt0A9331OQ7to-ECzrBNhxGlnI2eUYDNP-2JEP6WA4VRGWkIf9ykLMBiT-YscVYKA-a_2sN4l8s9t_kFy4dU%3D%40sagegerard.com.


Re: [racket-users] Why am I not fully releasing this SSL listener?

2020-07-24 Thread Sage Gerard
Switching the reuse? flag does resolve the issue, thanks! I'm also confused 
about the part you mention since reuse? is passed right along to tcp-listen in 
mzssl.rkt. Only difference I can point to is my explicitly calling ssl-close 
and therefore tcp-close before a custodian shutdown. But it sounds like you are 
saying the OS may temporarily reserve the port in spite of me doing that.

 Original Message 
On Jul 24, 2020, 1:27 PM, Ryan Culpepper wrote:

> If you create the ssl-listener with reuse?=true instead, like this
>
> (define listener (ssl-listen port 5 #f #t ctx))
>
> does the problem go away? If so, the error might happen because the OS 
> reserves the port number for a while after the listener is closed; see the 
> paragraph about TIME_WAIT in the tcp-listener docs. If that's the issue, I'm 
> a little confused why the TCP version would succeed, though.
>
> I believe SSL_shutdown is completely unrelated to the state of the TCP ports. 
> Think of it like a "Connection: close" HTTP header; it announces your 
> intention to close the TCP connection soon, but it has no actual effect on 
> the transport layer.
>
> Ryan
>
> On Fri, Jul 24, 2020 at 6:19 PM Sage Gerard  wrote:
>
>> I'm trying to understand how I am failing to shut down an ssl-listener on 
>> v7.7.0.5.
>>
>> https://gist.github.com/zyrolasting/bc5477bfa60d7185d0f53a5142545f88 shows 
>> my use of ssl-* procedures to transmit data using test.pem. The problem is 
>> that I cannot run the test submodule twice in a row because the listening 
>> port is still occupied on subsequent runs. I added ssl-close on top of a 
>> custodian shutdown and that problem reproduces.
>>
>> For comparison, 
>> https://gist.github.com/zyrolasting/3feb0ff4ecdf0b49bcf3e0ed8b630a06 avoids 
>> the ssl-* procedures and just uses vanilla TCP. I can run the tests fine 
>> then.
>>
>> But in looking at mzssl.rkt in the source, it looks like shutdown requires 
>> calling a foreign function via SSL_shutdown. 
>> https://github.com/racket/racket/blob/master/racket/collects/openssl/mzssl.rkt#L1417
>>
>> Do I have to call ports->ssl-ports out of band just so closing them sends a 
>> shut down as a side-effect? Or is keeping the port occupied between test 
>> runs a bug?
>>
>> ~slg
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/racket-users/EclLZhgUYlzvOx_uS0Ec154iNVVwXxNeZWcTIDzd72lwkA3M2OhVf8AW_cVMVUudM50kLuLVvnnnmiRGvZDvz5tPSUVOqFkC2LVI-2LY18Q%3D%40sagegerard.com](https://groups.google.com/d/msgid/racket-users/EclLZhgUYlzvOx_uS0Ec154iNVVwXxNeZWcTIDzd72lwkA3M2OhVf8AW_cVMVUudM50kLuLVvnnnmiRGvZDvz5tPSUVOqFkC2LVI-2LY18Q%3D%40sagegerard.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/GRZf-TLb6wY985IpEruFic60DW8gYFkKZNnR0gnEz_GXz6_lFMj-XEE7MryXy4M8ZrT2b8FIsGLyvcKBdqGpC52wxQ1UpISWwqFI7Fl1blk%3D%40sagegerard.com.


[racket-users] Why am I not fully releasing this SSL listener?

2020-07-24 Thread Sage Gerard
I'm trying to understand how I am failing to shut down an ssl-listener on 
v7.7.0.5.

https://gist.github.com/zyrolasting/bc5477bfa60d7185d0f53a5142545f88 shows my 
use of ssl-* procedures to transmit data using test.pem. The problem is that I 
cannot run the test submodule twice in a row because the listening port is 
still occupied on subsequent runs. I added ssl-close on top of a custodian 
shutdown and that problem reproduces.

For comparison, 
https://gist.github.com/zyrolasting/3feb0ff4ecdf0b49bcf3e0ed8b630a06 avoids the 
ssl-* procedures and just uses vanilla TCP. I can run the tests fine then.

But in looking at mzssl.rkt in the source, it looks like shutdown requires 
calling a foreign function via SSL_shutdown. 
https://github.com/racket/racket/blob/master/racket/collects/openssl/mzssl.rkt#L1417

Do I have to call ports->ssl-ports out of band just so closing them sends a 
shut down as a side-effect? Or is keeping the port occupied between test runs a 
bug?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/EclLZhgUYlzvOx_uS0Ec154iNVVwXxNeZWcTIDzd72lwkA3M2OhVf8AW_cVMVUudM50kLuLVvnnnmiRGvZDvz5tPSUVOqFkC2LVI-2LY18Q%3D%40sagegerard.com.


[racket-users] New package: place-controllers

2020-07-03 Thread Sage Gerard
Here's a way to encapsulate places in a generator-like procedure: 
[https://docs.racket-lang.org/place-controller/index.html](https://docs.racket-lang.org/place-controller/index.html?q=place%20con)

I ended up writing this to support a parallel build model, such that a single 
(apply sync (p1) (p2) ...) returns a value or status from a place, along with 
helpful context.

Source code is available at https://github.com/zyrolasting/place-controller

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/u08zPAJEDNgniFXvSgnTcupRTawCu9BaOM3WzNnxeZOhjQRKPvNCMJNbfdSGEFxfKZl-Hd1RXFkUfnEiJYCTZ_jS1FCBQGqq84wRJ0OT664%3D%40sagegerard.com.


[racket-users] New package: mind-map

2020-06-17 Thread Sage Gerard
I take notes using short indented lines, so I wrote a #lang using Pythonic 
indentation rules to interpret my notes as nodes in a mind map.

Source for the interested: https://github.com/zyrolasting/mind-map

With thanks to Hadi Moshayedi for racket-graphviz. I use that to render the 
maps.

Time permitting, the next feature is HTML+SVG output to enable hyperlinks on 
nodes. Currently I use single lines for vertex labels, but am considering 
sexprs or at-exprs for richer rendering.

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/jcxRJ45tYM_Fdy5uPs-idEvlfPeTbNA_UD3RavJ_x-q9FWnpPC_KmOQBH9tg07QfBqrHOnK5eBsQmsZrLHXl5rs1m0n9eGYF3Sr3scLO4j8%3D%40sagegerard.com.


Re: [racket-users] Why does this counter behave differently in different runtimes?

2020-06-17 Thread Sage Gerard
Thank you all so much! I'm glad it wasn't a huge mystery in the end.

 Original Message 
On Jun 17, 2020, 9:13 AM, Matthew Flatt wrote:

> Yes, clearly a BC compiler bug --- and probably almost as old as
> Racket. The bug was specific to `set!` on a locally bound variable as
> the first subexpression of `begin0`.
>
> I've pushed a repair.
>
> Thanks!
>
> At Wed, 17 Jun 2020 03:35:51 -0500, Alexis King wrote:
>> This is quite curious. It appears to be a compiler bug. Here’s a very 
>> slightly
>> smaller test case:
>>
>> #lang racket/base
>> (define count!
>> (let ([i 0])
>> (λ () (begin0
>> (set! i (add1 i))
>> (+ i)
>> (count!)
>>
>> The fully-expanded program looks fine, so it isn’t the expander’s fault:
>>
>> (module counter racket/base
>> (#%module-begin
>> (module configure-runtime '#%kernel
>> (#%module-begin (#%require racket/runtime-config) (#%app configure
>> '#f)))
>> (define-values
>> (count!)
>> (let-values (((i) '0))
>> (lambda () (begin0 (set! i (#%app add1 i)) (#%app + i)
>> (#%app call-with-values (lambda () (#%app count!)) print-values)))
>>
>> But `raco decompile` reveals that begin0 has been mysteriously replaced with
>> begin in the compiled program:
>>
>> (module counter 
>> (require (lib "racket/base.rkt"))
>> (provide)
>> (define-values
>> (count!)
>> (let ((local54 '0))
>> (begin
>> (set! local54 (#%box local54))
>> (lambda ()
>> '#(count! # 4 4 53 63 #f)
>> '(flags: preserves-marks single-result)
>> '(captures: (val/ref local54))
>> (begin
>> (#%set-boxes! (local54) (add1 (#%unbox local54)))
>> (+ (#%unbox local54)))
>> (#%apply-values print-values (count!))
>> (void)
>> (module (counter configure-runtime) 
>> (require '#%kernel (lib "racket/runtime-config.rkt"))
>> (provide)
>> (print-as-expression '#t)
>> (void)))
>>
>> It seems perhaps an optimization has gone awry. The bug appears to be quite
>> old: I can reproduce it as far back as 6.1.1. (I didn’t test any versions
>> earlier than that.) Unsurprisingly, the issue does not occur on Racket CS,
>> which is consistent with the hypothesis that this is a compiler bug.
>>
>> Alexis
>>
>> > On Jun 17, 2020, at 02:04, Sage Gerard  wrote:
>> >
>> > I attached a video demonstrating what I'm seeing. In case it does not load
>> or is not available, I'll summarize here. Forgive any typos; it's been a late
>> night of coding.
>> >
>> > Here's a module with an incorrect counter. It's incorrect because it uses
>> begin0, and is therefore expected to return void instead of an incrementing
>> integer.
>> >
>> > #lang racket
>> > (provide count!)
>> > (define count!
>> > (let ([i 0])
>> > (λ () (begin0
>> > (set! i (add1 i))
>> > (~v i)
>> >
>> > Notice that I added the ~v to format the return value. If I launch Racket
>> v7.7.0.5 using racket -it prog.rkt, (count!) returns the formatted value. But
>> if I remove the ~v, it behaves as written (returning void).
>> >
>> > The video shows the behavior with and without ~v, both in DrRacket and
>> racket. DrRacket is the only environment that consistently runs the code
>> correctly.
>> >
>> > ~slg
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/781BE0E5-E6E5-4F0B-8B46-5227FDFB
>> 8835%40gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200617071306.bc%40sirmail.smtp.cs.utah.edu.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/IH8l5cBwN3MPSWGHBWcbvDTEMikj3_ZDa5UWVtZ36bEabxTUzD8qamaPRE42q8U6mYRKYGKWit9Zh6cGYc7J7ibz2DmCeJ3dt0_4zJU5Vyc%3D%40sagegerard.com.


[racket-users] How do I properly set current-module-name-resolver for a process?

2020-05-19 Thread Sage Gerard
I'm trying to figure out how to set current-module-name-resolver in advance of 
all other code for a process. I'm guessing this would require a custom launcher 
that does (for example) `racket -l foo/replace-resolver bar.rkt`.

In that sense, I expect that a `replace-resolver` of the form below wouldn't 
work because it runs at phase 0, after the expander resolved everything for 
`bar.rkt`.

How do I do what I mean here across all phases, for all uses of 
(dynamic-|local-)require everywhere in my program?

(let ([old (current-module-name-resolver)])

  (current-module-name-resolver

   (case-lambda

 [(declared-module-name src-namespace)

  (old declared-module-name src-namespace)]

 [(module-path source-module stx should-load?)

  (old (maybe-rewrite-module-path module-path source-module)

   source-module

   stx

   should-load?)

  r])))

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/_cvEcFutv9gqlkwOX38uKhLoY-7MWpo24yP9DQLV-ml9bRLjiCG1aZmmIj5p3zeYxjyfPt0f65dei4MJcSUsuWX5lDcBSsO6QEW2wBlvFzI%3D%40sagegerard.com.


Re: [racket-users] Re: Requesting feedback on CSS3 parser and tokenizer

2020-05-12 Thread Sage Gerard
> I now very little about web technologies and web development, so this might
> be a stupid question:  could you explain what types of applications might
> need a to parse CSS files?

Linters and minifiers.

Linters are proofreaders for your code. They need to parse code to alert users 
to things like two items not being alphabetized, or inconsistent indentation. A 
good linter for CSS in particular is https://stylelint.io

Minifiers rewrite code to use the fewest possible characters. Good CSS 
minifiers need a parser to find repetition in some styles, and reorganize them 
accordingly.


> Are you working towards a web browser in Racket?

Gosh, no. A bare-bones browser is a summer project if you rush. A GOOD browser 
is a monstrous piece of software and I couldn't dream of implementing one 
without a dedicated team.

My needs are a little different. Right now if I move my website's files around, 
all of my files "follow" each other by updating their own relative paths. The 
part that does that for my CSS is precariously balanced on regular expressions. 
Having a CSS parser helps me do that better, and it gives me more processing 
options as a bonus. So if I later want to implement a minifier or a small 
linter, I can do so.


~slg

‐‐‐ Original Message ‐‐‐
On Tuesday, May 12, 2020 11:39 PM, Hendrik Boom  wrote:

> On Tue, May 12, 2020 at 05:35:59PM -0700, Alex Harsanyi wrote:
>
> > I now very little about web technologies and web development, so this might
> > be a stupid question: could you explain what types of applications might
> > need a to parse CSS files? I can only think of one, and that is a web
> > browser. Are you working towards a web browser in Racket?
>
> I think CSS can also be used in .odt format files. Not sure, though.
> Don't have my .odt manual at hand.
> And in .epub files.
>
> -- hendrik
>
> > Alex.
> > On Wednesday, May 13, 2020 at 6:37:22 AM UTC+8, Sage Gerard wrote:
> >
> > > I'm working to release a CSS3 tokenizer and parser to the catalog
> > > tomorrow.
> > > https://github.com/zyrolasting/css3-syntax
> > > The current state lacks tests, so any logic errors should keep me busy for
> > > a little longer. I'm here to ask for bug reports and feedback in the issue
> > > tracker since I had my head in the weeds long enough.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/268eace0-f69e-44d4-b59c-13ef767d1108%40googlegroups.com.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20200513033923.h4tbljscffhi3v66%40topoi.pooq.com.


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/Ccb2yGxs6DvC5aRHlpu-EUaziv5GQtNOlDP78G2gHjJawjlH825IKbGFMBIsR07DMIYxXet5AmmW7xCRj5xiZ_7Mf_AXXA_7lJVkBLVTEIw%3D%40sagegerard.com.


[racket-users] Requesting feedback on CSS3 parser and tokenizer

2020-05-12 Thread Sage Gerard
I'm working to release a CSS3 tokenizer and parser to the catalog tomorrow.

https://github.com/zyrolasting/css3-syntax

The current state lacks tests, so any logic errors should keep me busy for a 
little longer. I'm here to ask for bug reports and feedback in the issue 
tracker since I had my head in the weeds long enough.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/VOPNtQlIelbalknQ4qnuGfMGIskTTx7CbQXCZIhAz47QejITmyJ1SPGsP8S5XXLGa6GWQuGNPvGG-uj1-1vXOy8ZrFSckamfimz2toEmYUo%3D%40sagegerard.com.


Re: [racket-users] Re: Should I stop sending packages to the catalog?

2020-05-01 Thread Sage Gerard
As long as I don't have to keep reorganizing my code to accommodate the 
tooling, then it's a night and day improvement. Would you mind terribly if I 
worked with you? I was mulling over this myself in the dev list, but I am happy 
to aid any existing effort.

 Original Message 
On May 1, 2020, 12:59 PM, Bogdan Popa wrote:

> Alex Harsanyi writes:
>
>> As an application writer, I am on the other side of this problem, by
>> depending on other packages. Having limited time to work on my project I
>> want to upgrade package dependencies at my own pace.
>
> I'm in a similar position since I operate a few Racket applications.
>
> I'd been mulling over the idea of a snapshotting service for the main
> package catalog to help automate some of this over the past couple of
> months, but this thread finally pushed me to get started on building it.
>
> More details here: https://github.com/bogdanp/racksnaps
>
> It's not quite ready for general use yet (the first snapshot is being
> built as we speak), but I should be able to iron out the kinks over the
> next couple of weeks.
>
> I'm curious what folks think about this approach.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/m2k11vmw0d.fsf%40192.168.0.142.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/48J4XwYAvsHLrD7fsgD5_M1RutQcf_CobzsBJV-F5Ltg0i1YYIc4gf-9UMUN2QykF_a0drTjO5jiQ5-dcrGoO64AqrhKdD90Pse-TR28dOc%3D%40sagegerard.com.


Re: [racket-users] Should I stop sending packages to the catalog?

2020-04-30 Thread Sage Gerard
r git revision/tag. This might be particularly useful if
> a package relies on erroneous behavior of some package that was
> otherwise fixed.
>
> Jay
>
> ---------
>
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
>
> On Wed, Apr 29, 2020 at 12:47 PM Sage Gerard s...@sagegerard.com wrote:
>
> > April 9th in the #general Slack channel taught me that there was no clean 
> > way to
> > release a breaking change in a package. I'm open to working on version 
> > pinning
> > support in raco pkg provided that a maintainer can walk me through some 
> > code.
> > In the meantime, as much as I appreciate the efforts made in the current 
> > system,
> > I'm considering stopping my contributions to the package catalog until 
> > further notice.
> > I'm open to submitting packages if I am confident in their longevity, but I 
> > don't want
> > to end up in the position I've been in for the last few weeks when planning 
> > a release.
> > That position being an inability to release an edition that is not in some 
> > way "aware"
> > of a prior edition. In my view, changing the package/collection name is an
> > example of that problem, not a solution to it.
> > I'm considering asking my users to specify different package sources in 
> > their info.rkt
> > files when dealing with my work. Before I commit to that decision, I wanted 
> > to tap into
> > those of you who have already been here. How have you handled breaking 
> > changes
> > for your projects? How have you communicated with your users to make sure 
> > they
> > were adequately prepared? Am I being too black-and-white about this?
> > ~slg
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/3tKIr3GrU9Jnl7V-5yzb52OL3mjt8XNe9F_Qv9HDKwy8xC4j9lQo2e5eGSle4ZFHAee_FiGVhr15lXoovUE6yqoARP-ZNi3kXXz8ETXdufg%3D%40sagegerard.com.


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/64-_6PEVdP6dw67S-2haB3ogDOGv3HX1L8twXqXHDsiXktpUxs_79YMTgmn0U9lpvBhFrENOX5NHspleE-ncL2SIRChIDehEsBHK9cgYKQQ%3D%40sagegerard.com.


[racket-users] Should I stop sending packages to the catalog?

2020-04-29 Thread Sage Gerard
April 9th in the #general Slack channel taught me that there was no clean way to
release a breaking change in a package. I'm open to working on version pinning
support in raco pkg provided that a maintainer can walk me through some code.

In the meantime, as much as I appreciate the efforts made in the current system,
I'm considering stopping my contributions to the package catalog until further 
notice.
I'm open to submitting packages if I am confident in their longevity, but I 
don't want
to end up in the position I've been in for the last few weeks when planning a 
release.
That position being an inability to release an edition that is not in some way 
"aware"
of a prior edition. In my view, changing the package/collection name is an
example of that problem, not a solution to it.

I'm considering asking my users to specify different package sources in their 
info.rkt
files when dealing with my work. Before I commit to that decision, I wanted to 
tap into
those of you who have already been here. How have you handled breaking changes
for your projects? How have you communicated with your users to make sure they
were adequately prepared? Am I being too black-and-white about this?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3tKIr3GrU9Jnl7V-5yzb52OL3mjt8XNe9F_Qv9HDKwy8xC4j9lQo2e5eGSle4ZFHAee_FiGVhr15lXoovUE6yqoARP-ZNi3kXXz8ETXdufg%3D%40sagegerard.com.


Re: [racket-users] Rhombus project plan

2020-04-29 Thread Sage Gerard
Apologies if this is a tired question, and please link me to any answer I 
missed.

If Racket is a component of the overall system, does that imply that it can 
"reach out" from it's new home in the ecosystem and use all of the new features 
available beyond Phase 4?


~slg

‐‐‐ Original Message ‐‐‐
On Wednesday, October 2, 2019 3:27 PM, Matthew Flatt  wrote:

> [[NOTE: "Rhombus" is the new name for a design project formerly known
> as "Racket2", but "Rhombus" IS NOT THE FINAL NAME OF THE NEW LANGUAGE.
>
> "Rhombus" is the name of the project that will develop a language,
> and "Rhombus" is a temporary stand-in for a language name to be
> determined later. Phase 3 of the plan includes the mandatory step of
> picking a new language name.]]
>
> Rhombus is about building on the good parts of Racket and advancing the
> frontier of Racket-style language-oriented programming. A significant
> part of the experiment is trying a surface syntax other than
> parenthesized prefix notation. Another part is simplifying and
> generalizing elements of `#lang racket`, such as its data structures
> for streams and binding with integrated and extensible
> pattern-matching. While some of these goals could be pursued
> independently, taking them together offers opportunities to make the
> whole language fit together better.
>
> Whether Rhombus will become a suitable alternative for current `#lang racket` 
> can be determined only as the experiment progresses. It starts
> with that ambition, but the project may fail. It may fail for technical
> reasons, process reasons, or social reasons:
>
> -   On the technical side, we're trying to do something new.
> -   On the process side, we are trying a more visible and open approach
> than we have used for past major changes, even to the point of
> opening up the early exploratory phase.
>
> -   On the social side, we hope that skeptical Racketeers will make room
> for the experiment and understand that putting the experiment in the
> open (and being up-front about development costs) is part of the
> more open process.
>
> Matthew Flatt will lead the project with the guidance and consent of
> Racket project leadership. In early phases of the experiment, Matthew
> is responsible for delegating and deciding when the next phase starts.
> Toward the end of the process, Racket leadership is responsible for
> deciding whether to continue. Community participation is built into the
> process by keeping the design discussion open and by using an RFC
> process for the eventual design elements.
>
> What Will Happen to Racket During Rhombus
>
>
> The Racket team will continue to maintain the language and its
> implementations:
>
> -   The existing ecosystem will continue to function as always.
> -   Existing `#lang racket` programs will continue to run, just as in
> the 6.x and 7.x series of releases.
>
> -   The team will release updated versions, occasionally making modest
> incompatibilities with explicit transition paths as needed --- all
> as usual.
>
> This does not mean that the language and its implementation will evolve
> at the same speed as it has in the past, but it means that we will
> maintain our standard commitment to reliability and quality.
>
> Phase 1: Brainstorming (months)
>
>
> GOAL AND OUTPUT: A design sketch and collection of prototype
> implementations that reflect key ideas and design constraints.
>
> PROCESS: This is the current phase --- a discussion of ideas and
> potential directions at
>
> https://github.com/racket/rhombus-brainstorming
> [formerly "racket2-rfcs"]
>
> There will be some implementation in this phase to try things out, but
> at first only for exploration purposes.
>
> Initially, we want to address
>
> -   generality in the data structures and libraries,
> -   consistency in the binding names and terminology, and
> -   a surface syntax other than parenthesized-prefix notation.
>
> We also presuppose a potential transition from `#lang racket`, which
> will constrain the space of plausible languages. Depending on how this
> phase unfolds, we are willing to consider the addition of goals, their
> removal, or their reformulation.
>
> This process will take a while, because the space is very large,
> because different participants in the discussion will start with one
> set of opinions and end with different ones, and because all of this
> brainstorming and exploration will be publicly visible.
>
> Some draft proposals using the RFC template will be useful at this
> phase, similar to prototype implementations, but the process will be
> informal (so, not really an RFC process). The existing "Racket2 wish
> list" is also part of this phase, but some effort will be needed to
> select, consolidate, and elaborate wish-list items.
>
> CONCLUSION: The project leader will decide on the point where there's
> enough 

[racket-users] Reporting odd linklet error blocking my project

2020-04-23 Thread Sage Gerard
Reposting here. I'm experiencing what I believe is a blocker that is preventing 
me from building updates for my website. I am not at all sure how the private 
contract libs got into the shown state, but I left as many details as I knew to 
share.

Any assistance appreciated.

https://github.com/racket/racket/issues/3128

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/bEzEBrGCLUJfGtqo0gUdNU49HN0upit4w4tD-Fga9DhkJGULqa0urcjIfrw_37p9v3tynRih9BMtmNhApinZPT2ivWEEuvV6eXMLr91XYyw%3D%40sagegerard.com.


Re: [racket-users] Unfinished S-Expressions in scribbled code blocks

2020-04-12 Thread Sage Gerard
Does scribble/examples offer what you need?

 Original Message 
On Apr 12, 2020, 4:23 AM, Dominik Pantůček wrote:

> Hello fellow Racketeers,
>
> I've started a small side project and as a part of that I want to write
> some articles interspersed with code. Scribble was a natural choice for
> that task.
>
> So I started with #lang scribble/manual as usual and after writing some
> text, I tried to do something like the following:
>
> 
> #lang scribble/manual
>
> ... and here are the requires:
>
> @racketblock{
> (require
> }
>
> .. with the first one being this and we need that for 
>
> @racketblock{
> (only-in ffi/unsafe ptr-set! _uint32)
> }
>
> ...
> 
>
> Of course it renders the racketblocks as string, silly me. So I go for
> @racketblock[] but that - in @-syntax translates to S-expressions with
> "(require" (without the quotes) definitely not being a valid
> S-expression. And therefore scribble cannot handle it.
>
> Looking at [1] leaves me with an impression that it is not possible to
> typeset parts of racket code in scribble. Only valid S-expressions (and
> the #lang line, of course).
>
> Using scribble/lp2 I can get closer to my wanted result, but really it
> just works around the issue by forming valid S-expressions and expanding
> chunks inside those.
>
> What is the proper way of typesetting (in scribble) parts of racket code
> which do not form complete S-expression?
>
> And yes, I know this is rather strange requirement, but in this
> particular case, I am pretty sure, I want to work with parts of
> S-expressions without balanced parentheses. (Although the minimal
> example definitely does not answer "why").
>
> I assume I must have overlooked something, of course.
>
> Cheers,
> Dominik
>
> [1] https://docs.racket-lang.org/scribble/scribble_manual_code.html
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/d4473bd1-5b9c-b658-2989-df0a143d7ae9%40trustica.cz.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/kB7sQQDkefoEq86xajF1QifjjY-cWMqDfbxhD08dN2NqNBNnRn-8u6HX7lOA_JFhClSvgMhJdHxpI9MdEaB3oOpOQHEKNRFn1KCSexM86bg%3D%40sagegerard.com.


[racket-users] How to Create a Pollen Markup Alternative in 61 Lines

2020-02-29 Thread Sage Gerard
This is a fun workshop-style post as per the subject line. 
https://sagegerard.com/making-powerful-racket-markup.html

It took a while to figure out how to mix #langs without hitting the filesystem, 
let alone distill it to a post. If convenient, please play with this for a bit 
and see if you find any bugs or limitations?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/skgBH2Ih1T7BPO4XcIlq-waMilQNs8pFqgaf2FHlR_fvrDpCMZBi65KeMsyvh-HcAZQtmZ7LuBS23EQySESw1H4NW0giab3UKSjIXQhXVj0%3D%40sagegerard.com.


[racket-users] Creating Living Builds in Racket

2020-02-20 Thread Sage Gerard
I'm excited about this one: I put out an experimental release of 
unlike-assets/reactive and would love some feedback/shares.

https://sagegerard.com/unlike-assets-reactive-demo.html

TL;DR: That article is about making living builds in Racket, meaning an 
expression like (u/a "file.txt" number?) will always equal the current number 
of lines in file.txt.

But it's more than that: one living build can depend on others in arbitrary 
ways. For example, I can update a Racket file that provides CSS, and the href 
attribute for the associated  element in each of my HTML pages changes to 
.css to match.

I think this makes it easier to write alternatives to Frog, Pollen and 
Polyglot. A hard part in each of those projects is deciding how to handle some 
soup of incompatible assets, and I've been focused on a more general solution 
to that problem.

Follow-up articles will clarify how to make dependent living builds, and build 
servers. I'll probably do both by publishing the source code of my website.

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/jimzYUJVzP71Z5cqKer1NQUg2CU1qSU5mb9fSbjBlCVqQLaWGRdz4zLwXmTL1qYMZI_Hw4z806kXmj5AcQ6NnLDzOANxb4gfm64q8BCsN7M%3D%40sagegerard.com.


Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Sage Gerard
I'm very much in favor of interoperability and am happy to work in that 
direction. Does this imply that we need a #lang for each highlighting target? 
What happens if you want to highlight code mixtures? Some snippets of interest 
to me can include Javascript, Markdown, CSS, HTML and Racket all within 20 
lines.

 Original Message 
On Feb 19, 2020, 11:37 PM, Sorawee Porncharoenwase wrote:

> In my opinion, it would be very cool if the project is based on DrRacket’s 
> color-lexer ecosystem. So instead of writing an ad-hoc lexer for, say, 
> Python, we instead help improving the existing #lang python‘s color-lexer.
>
> Pro:
>
> - The result will look just like what DrRacket displays.
> - Integrate well with #lang. Potentially useful for Scribble, since right now 
> Scribble really only displays Racket code well.
> - Push the community to improve/write more color-lexer
>
> Con:
>
> - Token styles are pretty limited (only 8 categories), but then again, 
> perhaps this will push DrRacket to support more than 8 categories.
>
> It looks like we can programmatically extract information from color-lexer 
> via 
> [module-lexer](https://docs.racket-lang.org/syntax-color/index.html?q=syntax%20color#%28def._%28%28lib._syntax-color%2Fmodule-lexer..rkt%29._module-lexer%29%29).
>  See [this 
> file](https://github.com/racket/syntax-color/blob/master/syntax-color-test/tests/syntax-color/module-lexer.rkt)
>  for its usage.
>
> And since we use DrRacket’s ecosystem, we can go further than just syntax 
> highlighting. E.g., showing a binding arrow interactively when hovering mouse 
> over an identifier. The code example at [this 
> link](https://docs.racket-lang.org/drracket-tools/Accessing_Check_Syntax_Programmatically.html#%28def._%28%28lib._drracket%2Fcheck-syntax..rkt%29._annotations-mixin%29%29)
>  shows how we can extract such information.
>
> -
>
> On Wed, Feb 19, 2020 at 5:19 PM Sage Gerard  wrote:
>
>> Thank you for the reference, Martin. After looking at skylighting I ended up 
>> reading some XML specs in [1] after visiting Kate's.
>>
>> I can some potential shortcuts with the XML specs, but I'm seeing a lot of 
>> data-entry that won't really know how to highlight things like "->" in 
>> Racket or "X Y(Z);" in C++. I'm hoping parsack can handle these nuances. 
>> Still, the implementation burden is high and writing parsers means not 
>> having a syntax-highlighting data format.
>>
>> I'm thinking about writing the package such that a pre-installer builds an 
>> isolated Docker instance and runs a container for an existing 
>> highlighter--The goal being to provide what feels like a pure Racket package 
>> with no extra install steps. From there I can add parsack implementations 
>> over time. No clue how that will go.
>>
>> [1]: https://github.com/KDE/syntax-highlighting/tree/master/data/syntax
>>
>> ~slg
>>
>> ‐‐‐ Original Message ‐‐‐
>> On Wednesday, February 19, 2020 4:11 PM, Martin DeMello 
>>  wrote:
>>
>>> Nice, I'll be following this with interest! What are the pros and cons of 
>>> developing a new syntax highlighting format from scratch, versus e.g. 
>>> parsing and reusing the kate style files? For the latter route this haskell 
>>> package is a good source of inspiration: 
>>> https://hackage.haskell.org/package/skylighting
>>>
>>> martin
>>>
>>> On Tue, Feb 18, 2020 at 10:27 AM Sage Gerard  wrote:
>>>
>>>> Hi folks,
>>>>
>>>> I'm starting a syntax highlighter project here: 
>>>> https://github.com/zyrolasting/syntax-highlighting
>>>>
>>>> There seems to be a precedent for using an existing highlighter from 
>>>> another ecosystem. I understand the pragmatism behind that, but a syntax 
>>>> highlighter seems to me a missing battery in Racket.
>>>>
>>>> Without funding I am unable to compete with the implementations with 200+ 
>>>> languages supported. So I merely intend to provide two renderers (Terminal 
>>>> and HTML [XML syntax]), some palettes, and a sensible extension to parsack 
>>>> that classifies characters using Pygments' token classes. This should 
>>>> provide a strong, familiar core on which to add features according to 
>>>> community interest.
>>>>
>>>> That being said, I invite feedback and collaboration to add support for 
>>>> languages once the core mechanisms are established.
>>>>
>>>> ~slg
>>>>
>>>> --
>>>> You received this message b

Re: [racket-users] Starting syntax highlighter project

2020-02-19 Thread Sage Gerard
Thank you for the reference, Martin. After looking at skylighting I ended up 
reading some XML specs in [1] after visiting Kate's.

I can some potential shortcuts with the XML specs, but I'm seeing a lot of 
data-entry that won't really know how to highlight things like "->" in Racket 
or "X Y(Z);" in C++. I'm hoping parsack can handle these nuances. Still, the 
implementation burden is high and writing parsers means not having a 
syntax-highlighting data format.

I'm thinking about writing the package such that a pre-installer builds an 
isolated Docker instance and runs a container for an existing highlighter--The 
goal being to provide what feels like a pure Racket package with no extra 
install steps. From there I can add parsack implementations over time. No clue 
how that will go.

[1]: https://github.com/KDE/syntax-highlighting/tree/master/data/syntax

~slg

‐‐‐ Original Message ‐‐‐
On Wednesday, February 19, 2020 4:11 PM, Martin DeMello 
 wrote:

> Nice, I'll be following this with interest! What are the pros and cons of 
> developing a new syntax highlighting format from scratch, versus e.g. parsing 
> and reusing the kate style files? For the latter route this haskell package 
> is a good source of inspiration: 
> https://hackage.haskell.org/package/skylighting
>
> martin
>
> On Tue, Feb 18, 2020 at 10:27 AM Sage Gerard  wrote:
>
>> Hi folks,
>>
>> I'm starting a syntax highlighter project here: 
>> https://github.com/zyrolasting/syntax-highlighting
>>
>> There seems to be a precedent for using an existing highlighter from another 
>> ecosystem. I understand the pragmatism behind that, but a syntax highlighter 
>> seems to me a missing battery in Racket.
>>
>> Without funding I am unable to compete with the implementations with 200+ 
>> languages supported. So I merely intend to provide two renderers (Terminal 
>> and HTML [XML syntax]), some palettes, and a sensible extension to parsack 
>> that classifies characters using Pygments' token classes. This should 
>> provide a strong, familiar core on which to add features according to 
>> community interest.
>>
>> That being said, I invite feedback and collaboration to add support for 
>> languages once the core mechanisms are established.
>>
>> ~slg
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/racket-users/GC9QAolNyNFBE-KrDXfvA0q0P5_7jBWs7DEger3xGw5sYRmKg0rowpzyLIlyb1hrDOg_2xxTLn74TR5pCDIPhOzqIN5baGHoO7TU4GuaLDI%3D%40sagegerard.com](https://groups.google.com/d/msgid/racket-users/GC9QAolNyNFBE-KrDXfvA0q0P5_7jBWs7DEger3xGw5sYRmKg0rowpzyLIlyb1hrDOg_2xxTLn74TR5pCDIPhOzqIN5baGHoO7TU4GuaLDI%3D%40sagegerard.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/LKOhymlNe9MueHZQB8ErdJH7ySw_pTxDtsbZvNuXKWqEmGrFoOJl7SewhmwcS__qZunT6M6tzaMn_a-CjRFWEwfHhdrS2jfoKIBQkhkAzjM%3D%40sagegerard.com.


[racket-users] Starting syntax highlighter project

2020-02-18 Thread Sage Gerard
Hi folks,

I'm starting a syntax highlighter project here: 
https://github.com/zyrolasting/syntax-highlighting

There seems to be a precedent for using an existing highlighter from another 
ecosystem. I understand the pragmatism behind that, but a syntax highlighter 
seems to me a missing battery in Racket.

Without funding I am unable to compete with the implementations with 200+ 
languages supported. So I merely intend to provide two renderers (Terminal and 
HTML [XML syntax]), some palettes, and a sensible extension to parsack that 
classifies characters using Pygments' token classes. This should provide a 
strong, familiar core on which to add features according to community interest.

That being said, I invite feedback and collaboration to add support for 
languages once the core mechanisms are established.

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/GC9QAolNyNFBE-KrDXfvA0q0P5_7jBWs7DEger3xGw5sYRmKg0rowpzyLIlyb1hrDOg_2xxTLn74TR5pCDIPhOzqIN5baGHoO7TU4GuaLDI%3D%40sagegerard.com.


Re: [racket-users] plan to build a continuous integration system in racket

2020-02-17 Thread Sage Gerard
Yes, I understood that. Speaking for myself I'd want to see what other people 
are doing to inform my own designs. My suggestion was in that spirit.

 Original Message 
On Feb 17, 2020, 5:12 PM, Paulo Matos wrote:

> On Thursday, 13 February 2020 14:35:42 UTC+1, Sage Gerard wrote:
>
>> Some core devs are already looking into building a new CI/CD for use in the 
>> project. Maybe it would be worth taking a look at the Racket Slack and ask 
>> if you can participate in the #ci channel.
>
> Sage, correct me if I misunderstood but I think Xu wants to build a CI system 
> in Racket (like buildbot or CircleCI)- not necessarily a CI system for 
> Racket. So his work would be orthogonal to ours.
>
>> Re: web dev, maybe one of my posts can help, but it's more of a supplement 
>> to a guide you already read 
>> https://sagegerard.com/racket-webserver-notes.html
>>
>> I think it's a great idea to learn Racket in any case, but I'm not sure what 
>> your goals are in getting in the web field. The web-server package is a 
>> behemoth of an engineering effort, and it's use of serializable 
>> continuations is an advantage IMO. Is there anything else in particular that 
>> you are hoping to find?
>
>>  Original Message 
>> On Feb 13, 2020, 12:05 AM, Xu Xue < [xuu...@gmail.com](javascript:)> wrote:
>>
>>> Hi, all
>>>
>>> I am a senior student and plan to build a continuous integration system 
>>> using Racket as my graduation project.
>>>
>>> I'm very new to Racket web programming and CI/CD (about CI system I've 
>>> already found some great projects to refer to).
>>>
>>> I've just gone through [Web Applications in Racket] and bought [Server: 
>>> Racket].
>>>
>>> Are there any other starter resources or experiences to share about the 
>>> Racket web programming?
>>>
>>> Or maybe isn't it a good choice to dive into the web field using Racket?
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [racket...@googlegroups.com](javascript:).
>>> To view this discussion on the web visit 
>>> [https://groups.google.com/d/msgid/racket-users/3d98a427-f3a7-44d2-ad45-499a1f3cf83c%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/3d98a427-f3a7-44d2-ad45-499a1f3cf83c%40googlegroups.com?utm_medium=email_source=footer).
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/8a02ee3c-df50-4126-b030-4b3336492c6a%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/8a02ee3c-df50-4126-b030-4b3336492c6a%40googlegroups.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/pj0FW0rJ595P1szQPnIHKh6HhTwkGVaS_PIj89r-Qiuo2yzTgadsj0sssX7ZWQpjQLNXKpvTfTRxz1VlJpkzFoxe7OPboZdhGuRG5L3Ktzg%3D%40sagegerard.com.


Re: [racket-users] Questions on a very simple class

2020-02-15 Thread Sage Gerard
1. If the intention is to create a class, then I'd use the class form.

https://docs.racket-lang.org/reference/createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._class%2A%29%29

Not that there's anything overtly wrong with using a closure, but common 
validation tasks re: inheritance, overriding, etc. all have to be done by hand 
here.

2. What specific error message did you get?

~slg

‐‐‐ Original Message ‐‐‐
On Saturday, February 15, 2020 6:18 PM, Alain De Vos  
wrote:

> Following code makes an "integerclass" with an "add" method :
>
> #lang racket
> (define (integerclass x)
>   (define (getx)  x)
>   (define (setx! x_new) (set! x x_new))
>   (define (add y)(integerclass (+ x (y 'getx
>   (lambda (message . args)
> (case message
> ((getx)  (apply getxargs))
> ((setx!) (apply setx!   args))
> ((add)   (apply add args))
>   (else (error "POINT: Unknown message ->" message)
>
> (define (myprint x) (print x)(newline))
> (define p1 (integerclass 1))
> (myprint (p1 'getx))
> (define p2 (integerclass 2))
> (myprint (p2 'getx))
> (define p3 (p1 'add p2))
> (myprint (p3 'getx))
>
> Question 1 : can this code be inproved, are there "better patterns" one can 
> you.
> Question 2 : can i modify this code to use typed/racket. I tried but failed 
> on the "apply" method in the code.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/c28892b8-e49b-4257-9ebe-4560943e87a7%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/c28892b8-e49b-4257-9ebe-4560943e87a7%40googlegroups.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/gUC9HzrnJWNGbe-kgcoyov8KOUFY7sKw4KNu2CfqFABrsW0dsGpLsPfuKAHmcoXMBFECT4Bln1wQMYhpOFhL_y4WjYY-RWnveapTNESXHoc%3D%40sagegerard.com.


Re: [racket-users] plan to build a continuous integration system in racket

2020-02-13 Thread Sage Gerard
Some core devs are already looking into building a new CI/CD for use in the 
project. Maybe it would be worth taking a look at the Racket Slack and ask if 
you can participate in the #ci channel.

Re: web dev, maybe one of my posts can help, but it's more of a supplement to a 
guide you already read https://sagegerard.com/racket-webserver-notes.html

I think it's a great idea to learn Racket in any case, but I'm not sure what 
your goals are in getting in the web field. The web-server package is a 
behemoth of an engineering effort, and it's use of serializable continuations 
is an advantage IMO. Is there anything else in particular that you are hoping 
to find?

 Original Message 
On Feb 13, 2020, 12:05 AM, Xu Xue wrote:

> Hi, all
>
> I am a senior student and plan to build a continuous integration system using 
> Racket as my graduation project.
>
> I'm very new to Racket web programming and CI/CD (about CI system I've 
> already found some great projects to refer to).
>
> I've just gone through [Web Applications in Racket] and bought [Server: 
> Racket].
>
> Are there any other starter resources or experiences to share about the 
> Racket web programming?
>
> Or maybe isn't it a good choice to dive into the web field using Racket?
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/3d98a427-f3a7-44d2-ad45-499a1f3cf83c%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/3d98a427-f3a7-44d2-ad45-499a1f3cf83c%40googlegroups.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/NgeFdLW_YU4fGDCPeL8gRH-RPBkyHpBgAd5bVClXHTrwXmkcly0-5qn71BZ1M3Giw2j8i6RSjAnpUauaDHYVI9Q9xz7K0huWUW5apEoC_OA%3D%40sagegerard.com.


Re: [racket-users] Announcing something Kinda FRP-y

2020-01-27 Thread Sage Gerard
I did not even think to extend it that way! What a cool suggestion. Right now I 
am working on a macro as defined here, since there are times it makes sense to 
list dependencies explicitly https://github.com/zyrolasting/kinda-ferpy/issues/2

Now if I could get a #-notation to support explicit dependencies without 
sacrificing too much readability, I'd probably prefer it over all other 
variants.
 Original Message 
On Jan 27, 2020, 2:09 PM, Eric Griffis wrote:

> Hi Sage,
>
> This is pretty cool. With a non-OOP option on the table, I might
> finally get around to working on an IMGUI-like for Racket.
>
> Have you thought about a reader extension to compress the notation?
> The `stateful-cell` function kinda acts like a box and kinda looks
> like a `syntax` (or `quote-syntax` w/ kw arg) form, both of which have
> special #-prefixed notations. Extending the reader to abbreviate
> `(stateful-cell 1)` and `(stateful-cell (λ _ (+ (x) (y` to, say,
> #?1 and #?(+ (x) (y)), respectively, could be a fun project.
>
> Eric
>
> On Sun, Jan 26, 2020 at 3:30 PM Sage Gerard  wrote:
>>
>> Announcing a new package: kinda-ferpy. Here's a write-up. It implements the 
>> spreadsheet metaphor in an expressive way, based on MaiaVictor's excellent 
>> PureState library. It's not a complete functional reactive programming 
>> interface, but it does conveniently express Racket values as dependent 
>> computations.
>>
>> (require kinda-ferpy)
>>
>> (define x (stateful-cell 1))
>> (define y (stateful-cell 1))
>> (define sum (stateful-cell (λ _ (+ (x) (y)
>>
>> (displayln (sum)) ; 2
>> (y 8)
>> (displayln (sum)) ; 9
>>
>>
>> ~slg
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/QO0uwg7I2YeD0nczzY77m3RVr6TceC-IY1YunNNYqiq55n_bjHpKh-Rnf5xo1zGgLa44giG3SmxwhenvbHt84u4J4Rm6M2whybBOpWxuCtY%3D%40sagegerard.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAORuSUw8fDe8CtxKH-gCke3hoWnhekUHMx8B9DxvYcn8HwaHnw%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/dnUcsewHmSYVUYEGG53YGS6nma42afV1c4N8n4HBIvkDjwdPxDKXQnbRLHzmaRMonDHIbNO-gAuT9kZF1jqdZGDITdq7xHgNRktTzCa_1dw%3D%40sagegerard.com.


[racket-users] Announcing something Kinda FRP-y

2020-01-26 Thread Sage Gerard
Announcing a new package: kinda-ferpy. Here's a 
[write-up](https://sagegerard.com/kinda-ferpy-intro.html). It implements the 
spreadsheet metaphor in an expressive way, based on MaiaVictor's excellent 
[PureState library](https://github.com/MaiaVictor/PureState). It's not a 
complete functional reactive programming interface, but it does conveniently 
express Racket values as dependent computations.

(require kinda-ferpy)

(define x (stateful-cell 1))
(define y (stateful-cell 1))
(define sum (stateful-cell (λ _ (+ (x) (y)

(displayln (sum)) ; 2
(y 8)
(displayln (sum)) ; 9

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/QO0uwg7I2YeD0nczzY77m3RVr6TceC-IY1YunNNYqiq55n_bjHpKh-Rnf5xo1zGgLa44giG3SmxwhenvbHt84u4J4Rm6M2whybBOpWxuCtY%3D%40sagegerard.com.


Re: [racket-users] Showing off Goblins' time-traveling-debugging support in Terminal Phase

2020-01-26 Thread Sage Gerard
Nice, I'll actually be competing with a flavor of MaiaVictor's library for 
reactive models. Time travel is a great add!

 Original Message 
On Jan 26, 2020, 3:07 PM, Christopher Lemmer Webber wrote:

> Not the most interesting part of Spritely Goblins (that is in the
> async/distributed stuff, to-be-demo'ed), but something I wrote about
> recently and maybe I should link here too:
>
> https://dustycloud.org/blog/goblins-time-travel-micropreview/
>
> Of course, as functional programmers, time-travel isn't that novel.
> What's more interesting is how to make it comfortable* when we have many
> independently acting objects.
>
> More to come later.
>
> - Chris
>
> * Without introducing the m-word** (which isn't very comfortable for
> many)
>
> ** monad***
>
> *** one could argue that Goblins kind of can be perceived of as an
> implicit monad but the important thing is that this framing is not
> exposed to users
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/87o8uq2d7s.fsf%40dustycloud.org.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/f4ncHKjV3F9EQ07Xp5zz-HL_cZqmv_t-c5ayjgblvT7aaNa5ya8rRkwck7oOtLVuPxUWjcIKE1VAXyU7oZTWCzpNtjsDIMVo8_rWnxKx65w%3D%40sagegerard.com.


Re: [racket-users] Re: Racket2 and syntax

2020-01-13 Thread Sage Gerard
I'd take this thread as evidence that outdated information is easier to 
discover than Rhombus. How many mentions of "Racket2" currently ranking in 
search engines have added mentions of Rhombus? Maybe it's not a big problem 
right now, but could it get harder to manage?

 Original Message 
On Jan 13, 2020, 10:57 AM, Matthew Flatt wrote:

> The project name is "Rhombus". The language name is TBD.
>
> https://groups.google.com/forum/#!msg/racket-users/-x_M5wIhtWk/V47eL30HCgAJ
>
> At Mon, 13 Jan 2020 07:38:55 -0800 (PST), John Cowan wrote:
>>
>>
>> On Sunday, July 14, 2019 at 10:30:04 PM UTC-4, Matthew Flatt wrote:
>>
>> At RacketCon today, after summarizing the state of work on Racket CS, I
>> > recommended that we next explore the possibly of changing to an
>> > infix-oriented syntax in "Racket2".
>> >
>>
>> I realize that Racket2 is the name of the project, but I think it's very
>> important that the *language* of the project gets its own unique name.
>> Otherwise outsiders will see it as the successor, the important one, the
>> one they should use by default, because they will think Racket1 (which will
>> quickly become the human-oriented name of the existing language) has become
>> obsolete. Larry Wall just changed the name of Perl 6 to Raku, and this is
>> a Good Thing, because it deflects the "When are you going to replace Perl
>> 5?" question.
>>
>>
>>
>> John Cowan http://vrici.lojban.org/~cowan co...@ccil.org
>> I don't know half of you half as well as I should like, and I like less
>> than half of you half as well as you deserve. --Bilbo
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/2f002c9e-61f2-4fd4-8014-0cd3d4e6
>> 1853%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/5e1c935f.1c69fb81.9e1f7.8c0bSMTPIN_ADDED_MISSING%40gmr-mx.google.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/ej9qnjScrVxmPRzR0q_BhKCTykSjAFnZtl1CGWqoCOFM-Vwky8GkLLl4t1fVXYtk2ZVBta3NOTdyuKdO7ecIt3BoppnSsJP4UTiOuUoOT_g%3D%40sagegerard.com.


Re: [racket-users] telnet postcard.sfconservancy.org 2333

2019-12-19 Thread Sage Gerard
Super cool, and a catchy way to send it out!

 Original Message 
On Dec 19, 2019, 11:56 AM, Christopher Lemmer Webber wrote:

> If you enter the subject of this email into a terminal, you'll see a
> cool, live Racket "greetings card" for my friends at Software Freedom
> Conservancy's fundraiser:
>
> https://sfconservancy.org/supporter/
>
> The animation is itself a Racket program! You can run it yourself, on
> your own machine!
>
> https://gitlab.com/dustyweb/conservancy-postcard
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/878sn8z235.fsf%40dustycloud.org.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/lOFGRGjOP1X06l0sv-FmXvPcLtCKaDpYeMILy9QiGuGGefoCSadWV0fyAQGMJTH7lTk_4ow5q5YH-JbYt5pA6lB4HTXsG9tPzMfJKqYvzVs%3D%40sagegerard.com.


Re: [racket-users] xml library clarification - "" symbol parsing

2019-11-22 Thread Sage Gerard
I'm interested in this quote:

>  [...] creating a huge problems with even simple XML parsing. (I am basically 
> battling XML lib all day already to do most simple tasks)

I think that when you asked about why the xml collection behaves the way it 
does, the conversation turned away from your experience.

Could you elaborate on the specifics of what you are trying to do in one of 
your projects so that we can see your pain points in context?

~slg

‐‐‐ Original Message ‐‐‐
On Friday, November 22, 2019 12:43 AM, Kira  wrote:

> I understand that there is no law that forbids some ways of XML parsing. :)
> My question is in another plain.
> Perhaps some other languages have the same realization?
> I am trying to understated what purpose it serves? Does this done 
> intentionally, or this is just random side effect?
>
> For example this particular thing hit me when I tried to use (se-path*) and 
> (se-path*/list), because this quotes just trowed in plain list with the text, 
> lets say I can filter them, but how I must solve this if there will be such 
> quotes inside the text?
>
> Yes, they are equivalent by this particular parser/format design, but they 
> are semantically distinct by reality.
>
> As well as escape strings from other characters. I am trying to understated 
> why this particular semantic distinction is taken into account.
>
> I am trying to understand why xml lib makes this semantic distinction when 
> format does not defines such thing.
>
>> But AFAIK there is nothing in the XML spec that requires XML to be parsed in 
>> your preferred style. So it is not "wrong behavior".
>>
>> Moreover, if you are writing code that treats '(tag "a" "b") and '(tag "ab") 
>> as semantically distinct, that's a code smell, because as XML, they're 
>> equivalent:
>>
>> #lang racket
>> (require xml rackunit)
>> (check-equal? "ab" (xexpr->string '(tag "a" "b")))
>> (check-equal? "ab" (xexpr->string '(tag "ab")))
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/df1e76f4-6459-4c12-b85e-f36c2d4bd13c%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/df1e76f4-6459-4c12-b85e-f36c2d4bd13c%40googlegroups.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/8iLbPjBdD7iU3TBaUexPo94Pmb-OkV9SPPlLPVQpP5yyiTKcOqkcGYsiS1rmT0r0J5z_o4QUZn-we1dq791e0m7pb8fGxh7RHfvji8XzG_U%3D%40sagegerard.com.


[racket-users] Vulkan integration: Contributors Update

2019-11-15 Thread Sage Gerard
New update on the Vulkan collection: 
https://sagegerard.com/racket-vulkan-contributors-update.html

High points:

- A CLI is now available to control code generators and Vulkan specifications. 
You can now generate Racket bindings that don't need a code dependency on the 
collection, and can keep up with Vulkan even if the collection is out of date.
- There are now enough things to do that it's getting hard to prioritize. My 
focus recently has been maintainability/stability, with passive effort on a 
vulkan-tutorial.com port. I'll be asking the author to feature the example 
alongside the Rust variant of the tutorial.
- A contributor guide has been added to the docs.

Inspiration is kicking in. #lang for system requirements, shaders, and assets, 
oh my!

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/yNN1RTqu4C4eBNOr1Fl6X3MVQqXYhVzvHwZe82qlPLKEqBEJ7wI7U1-CpeidxukqdVjEVT1tg7EPUseM9NZSy_XLUDFsCMsXOprdJLpC5nE%3D%40sagegerard.com.


Re: [racket-users] FFI Object Deallocator Not Called

2019-11-07 Thread Sage Gerard
To add: Is it wise to put (begin (sync (system-idle-evt)) (collect-garbage)) in 
a flush callback on the exit handler's plumber?

~slg

‐‐‐ Original Message ‐‐‐
On Thursday, November 7, 2019 1:02 PM, Bryant Curto  
wrote:

> Thank you Matthew for your response!
>
>>One catch is that finalization callbacks are run in a separate (privileged) 
>>thread.
> To clarify, do you mean a Racket thread or an OS thread?
>
> On Thursday, November 7, 2019 at 8:26:29 AM UTC-5, Matthew Flatt wrote:
>
>> At Tue, 5 Nov 2019 14:14:00 -0800 (PST), Bryant Curto wrote:
>>> I have an FFI object I created with an allocator/deallocator wrapper pair,
>>> but the deallocation function never appears to get called.
>>> I'm invoking garbage collection explicitly before shutdown with no success.
>>
>> One catch is that finalization callbacks are run in a separate
>> (privileged) thread. You may have to interleave `(collect-garbage)`
>> with `(sync (system-idle-evt))` to trigger finalization.
>>
>>> Is there something I'm missing? Is there a good way to debug garbage
>>> collection decisions?
>>> I saw a configuration flag called --enable-backtrace and am thinking that
>>> it might be useful, but am not sure where to start.
>>
>> Yes, building with `--enable-backtrace` and using `dump-memory-stats`
>> to get traces can be helpful. The implementation is a little flaky, but
>> it normally works.
>>
>> Backtrace support in Racket CS is always enabled and it's not flaky, so
>> trying with Racket CS is another option.
>>
>> Matthew
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/3abd5a70-ed49-4fcc-8de4-590e512b665e%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/3abd5a70-ed49-4fcc-8de4-590e512b665e%40googlegroups.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/gq68uvUZV3YPXpMoOhAgac3s0NaNJuK4y-jkFg2UOUPGiDVPzi92G5GRF9HSd279-Iea005hkPt9bRtoTRj48whig_-4v-EeYmzZY0CfjOk%3D%40sagegerard.com.


[racket-users] How should I track versions for racket-vulkan?

2019-11-01 Thread Sage Gerard
Re: racket-vulkan, I'd like to have a version number that conveys which version 
of the Vulkan specification I'm tracking, as well as the version of the 
utilities I write surrounding it.

Per the docs for (valid-version?) and package metadata, it does not look like I 
can do this well. I'm not even seeing anything about specifying custom 
metadata. Is that in an entirely different part of the docs?

Here are the options I see so far:

- Smush the Vulkan spec version and my actual package version in a 
‹maj›.‹min›.‹sub›.‹rel› string and come up with rules to extract both.

- Version only the code in my package. Oblige people needing to upgrade to 
check if the spec version supported by the package has changed either by 
reading a changelog or calling a procedure in the upgraded package. Come up 
with rules re: what a Vulkan version change does to my package version.

- Create a second package.

I'm not crazy about any of these options, but am leaning towards the first 
since its the most friendly to deployment automation, has the smallest support 
commitment, and keeps the "one stop-shop" experience I'd want to provide.

But is there a better way?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/Lcb3ALbl9B3qhFlVSQVLzSBKhf1CLN8nrCH0TOcoHXmpP8o4CUqXDecUBeha7Y_q2f10sLRAkEnBsK1BUujNfDePXJy674nLoHn6Ad_HRMQ%3D%40sagegerard.com.


Re: [racket-users] Help me understand FFI callouts in this context?

2019-10-30 Thread Sage Gerard
Hi Matthew,

I reproduced "SIGSEGV MAPERR si_code 1 fault on addr (nil)" after specifying 
'#:atomic? #t', so not out of the woods yet.

If you wish I can help you set up Vulkan off-list.

> Will the callback definitely be invoked in the same OS-level thread as calls 
> to Vulkan functions?

Yes. [1]

Even so, I specified #:async-apply for grins. No change in behavior.

The only new development I can share is that the program now functions 
correctly, provided that if I comment out the expression that tries to register 
the callback. Previously the program was not even finished, so I can at least 
say the problem is isolated.

I tried setting PLTSTDOUT to "debug" and prepared a diff between the output 
when I try to use the callback, and the output when I don't try at all. Sadly, 
when the program breaks the last line from STDOUT is 'ffi-lib: loaded 
"libvulkan.so"'.

I'll wait for one more round of advice on troubleshooting before writing a 
repository that reproduces the problem with added logging in a C shim.

[1]: 
https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VkDebugReportCallbackCreateInfoEXT,
 "A callback will always be executed in the same thread as the originating 
Vulkan call."


~slg

‐‐‐ Original Message ‐‐‐
On Tuesday, October 29, 2019 9:35 AM, Matthew Flatt  wrote:

> I haven't been able to get Vulkan going on my machines, so I can't run
> your code enough to offer reliable advice.
>
> Still, I wonder whether making the callback atomic has any effect.
> To make the callback atomic:
>
> -   Change the definition of `_PFN_vkDebugReportCallbackEXT` to add
> `#:atomic? #t` after `_fun`.
>
> -   Don't use `printf` in the callback, because that's not safe from
> atomic code. Instead, use logging, which is ok to use from atomic
> code.
>
> "Atomic" means atomic with respect to the Racket runtime system, so
> Racket won't try to swap its threads while running the callback.
> Swapping threads involves coping the C stack, which often annoys C/C++
> libraries.
>
> Will the callback definitely be invoked in the same OS-level thread as
> calls to Vulkan functions? If not, then specify `#:async-apply (lambda 
> (thunk) (thunk))` alongside `#:atomic? #t` to make sure the callback is
> run in Racket's thread.
>
> At Sun, 27 Oct 2019 19:57:52 +, Sage Gerard wrote:
>
>
> > I was still stumped on this one due to the opaque error message and repeated
> > comparisons to the original source appearing correct. I stepped away for a
> > while to think about it, and the only option I see to help me along is to
> > write a shared library in C that behaves similarly, and have it log noisily 
> > to
> > STDOUT whatever it gets from a Racket program.
> > Since writing this shim would be tedious, are there any additional
> > troubleshooting techniques or tools unique to Racket that can help me narrow
> > down the root cause of a crash in foreign code?
> >  Original Message 
> > On Oct 25, 2019, 1:56 AM, Sage Gerard wrote:
> >
> > > Hi Ryan, and thank you for the detailed and informative reply!
> > > I gathered that I should trust Racket's handling of values across the
> > > foreign boundary more,
> > > and used what I learned from your email to get past one error. Sadly, I
> > > landed on
> > > "SIGSEGV MAPERR si_code 1 fault on addr (nil)" right after, and under a
> > > different context.
> > > The affected expression can be found at 1, and I verified that I do not
> > > try to use a NULL pointer.
> > > This is a case where foreign function returns a "dummy" pointer to another
> > > function whose
> > > signature the client is expected to know in advance, but the address of 
> > > the
> > > foreign
> > > function would NOT be known to get-ffi-obj since the procedure is loaded
> > > dynamically
> > > by the library itself 2.
> > > The Vulkan docs call for casting this pointer to the function I need. So 
> > > if
> > > I'm understanding your email
> > > correctly, I need to prepare a value such that I produce a callout object
> > > that knows the right signature.
> > > I tried using (cast) and (function-ptr), both of which failed with 
> > > different
> > > errors. The SIGSEGV error
> > > came from the (cast) case, which is visible in the source code now a few
> > > lines above the linked line.
> > > (function-ptr) seemed to produce a callback and not a callout, so it's 
> > > still
> > > not useful:
> > > ;

Re: [racket-users] Help me understand FFI callouts in this context?

2019-10-27 Thread Sage Gerard
I was still stumped on this one due to the opaque error message and repeated 
comparisons to the original source appearing correct. I stepped away for a 
while to think about it, and the only option I see to help me along is to write 
a shared library in C that behaves similarly, and have it log noisily to STDOUT 
whatever it gets from a Racket program.

Since writing this shim would be tedious, are there any additional 
troubleshooting techniques or tools unique to Racket that can help me narrow 
down the root cause of a crash in foreign code?

 Original Message 
On Oct 25, 2019, 1:56 AM, Sage Gerard wrote:

> Hi Ryan, and thank you for the detailed and informative reply!
>
> I gathered that I should trust Racket's handling of values across the foreign 
> boundary more,
> and used what I learned from your email to get past one error. Sadly, I 
> landed on
> "SIGSEGV MAPERR si_code 1 fault on addr (nil)" right after, and under a 
> different context.
> The affected expression can be found at [1], and I verified that I do not try 
> to use a NULL pointer.
>
> This is a case where foreign function returns a "dummy" pointer to another 
> function whose
> signature the client is expected to know in advance, but the address of the 
> foreign
> function would NOT be known to get-ffi-obj since the procedure is loaded 
> dynamically
> by the library itself [2][3].
>
> The Vulkan docs call for casting this pointer to the function I need. So if 
> I'm understanding your email
> correctly, I need to prepare a value such that I produce a callout object 
> that knows the right signature.
> I tried using (cast) and (function-ptr), both of which failed with different 
> errors. The SIGSEGV error
> came from the (cast) case, which is visible in the source code now a few 
> lines above the linked line.
>
> (function-ptr) seemed to produce a callback and not a callout, so it's still 
> not useful:
>
> ; application: not a procedure;
> ; expected a procedure that can be applied to arguments
> ; given: #
>
> I understand your point about conversions automatically happening as values 
> pass
> across the FFI boundary. But if I can't specify the requested type UNTIL a 
> (cast)
> and I'm sure the destination signature is correct, then what do I make of the 
> SIGSEGV error?
>
> [1]: 
> https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L260
> [2]: https://stackoverflow.com/a/37900692
> [3]: 
> https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkGetInstanceProcAddr.html
>
> ~slg
>
> ‐‐‐ Original Message ‐‐‐
> On Thursday, October 24, 2019 8:54 PM, Ryan Culpepper  
> wrote:
>
>> On 10/25/19 12:45 AM, Sage Gerard wrote:
>>
>> > I am porting some C++ code to Racket that uses a function pointer.
>> > C++ origin: See 294 through 306:
>> > https://github.com/Erkaman/vulkan_minimal_compute/blob/master/src/main.cpp#L294
>> > Racket destination:
>> > https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L240
>> > How do I use function-ptr on debug-report-callback to produce a valid
>> > function pointer matching this signature
>> > https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/PFN_vkDebugReportCallbackEXT.html?
>> > My current error comes from line 250, on the expression (function-ptr
>> > debug-report-callback _PFN_vkDebugReportCallbackEXT):
>> > ; function-ptr: contract violation
>> > ;   expected: (and ctype? (lambda (ct) (eq? 'fpointer (ctype->layout ct
>> > ;   given: #
>> > It seems that my error was that _PFN_vkDebugReportCallbackEXT was
>> > (_cpointer/null (_fun ...)), but I am not sure what should take its place.
>> >
>> > - If I substitute _fpointer for _PFN_vkDebugReportCallbackEXT, I get
>> > the "application; not a procedure" error.
>> >
>> > - If I substitute the _fun form with the signature I want, then I get
>> > "#->C: argument is not `#' pointer"
>> >
>> >
>> > I suspect this has something to do with the /callout/ concept from the
>> > manual, but I don't understand how it applies here.
>>
>> The use of _cpointer/null seems wrong: its first argument is interpreted
>> as a tag, so that's the source of the last error you mentioned. The
>> `_cpointer/null` is unnecessary anyway, so just delete it:
>>
>> (define _PFN_vkDebugReportCallbackEXT (_fun ))
>>
>> On line 250: I don't think you need to use function-ptr. The field
>> setter will automatically convert debug-report-callback (I assume that's
>&

Re: [racket-users] eq? of quoted expressions

2019-10-25 Thread Sage Gerard
Typo: Meant (let ([l (quote (a))]) (eq? l l))


~slg

‐‐‐ Original Message ‐‐‐
On Friday, October 25, 2019 12:28 PM, Sage Gerard  wrote:

> By https://docs.racket-lang.org/reference/symbols.html, Two interned symbols 
> are eq? to each other.
>
> But in the other example, you are comparing two lists each containing a 
> single symbol. A new list is created in each expression, and eq? is comparing 
> the object references and not the content. For comparison (let ([l (quote 
> a)]) (eq? l l)) evaluates to #t
>
> ~slg
>
> ‐‐‐ Original Message ‐‐‐
> On Friday, October 25, 2019 10:34 AM, wanderley.guimar...@gmail.com 
> wanderley.guimar...@gmail.com wrote:
>
> > Why (eq? (quote a) (quote a)) is #t but (eq? (quote (a)) (quote (a)))
> > is #f? I would expect that if (quote (a)) was a mutable pair but it
> > is not since (quote (a)) returns #f. It seems that guile returns #t
> > as I was expecting.
> >
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/CAAmHZof2uu7hkU4eMNz510UFOX4Pn5RUhj08_zHobqCcshdhug%40mail.gmail.com.


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/76VbcI1e7gI8Isj-LBsBSkCMeRk7zVJx8tkYRCHVU6wOeJG7cuSCy2KQtts5Y5TKVHm74BBMHCnuoqPCZm2Li9wlrc3LOY8W3vHYFEXehyo%3D%40sagegerard.com.


Re: [racket-users] eq? of quoted expressions

2019-10-25 Thread Sage Gerard
By https://docs.racket-lang.org/reference/symbols.html, Two interned symbols 
are eq? to each other.

But in the other example, you are comparing two lists each containing a single 
symbol. A new list is created in each expression, and eq? is comparing the 
object references and not the content. For comparison (let ([l (quote a)]) (eq? 
l l)) evaluates to #t

~slg

‐‐‐ Original Message ‐‐‐
On Friday, October 25, 2019 10:34 AM, wanderley.guimar...@gmail.com 
 wrote:

> Why (eq? (quote a) (quote a)) is #t but (eq? (quote (a)) (quote (a)))
> is #f? I would expect that if (quote (a)) was a mutable pair but it
> is not since (quote (a)) returns #f. It seems that guile returns #t
> as I was expecting.
>
> --
>
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAAmHZof2uu7hkU4eMNz510UFOX4Pn5RUhj08_zHobqCcshdhug%40mail.gmail.com.


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/yT81-_ZRmjRpBGWsbWng8eFEx3qSl0zijv0vEMKfnRdOg0X5At1HSiV5WyRnQnBWutXhPh4T9GnMDupmoV4j6ENTM3zvYBPPp50M9Pkrhl0%3D%40sagegerard.com.


Re: [racket-users] Help me understand FFI callouts in this context?

2019-10-24 Thread Sage Gerard
Hi Ryan, and thank you for the detailed and informative reply!

I gathered that I should trust Racket's handling of values across the foreign 
boundary more,
and used what I learned from your email to get past one error. Sadly, I landed 
on
"SIGSEGV MAPERR si_code 1 fault on addr (nil)" right after, and under a 
different context.
The affected expression can be found at [1], and I verified that I do not try 
to use a NULL pointer.

This is a case where foreign function returns a "dummy" pointer to another 
function whose
signature the client is expected to know in advance, but the address of the 
foreign
function would NOT be known to get-ffi-obj since the procedure is loaded 
dynamically
by the library itself [2][3].

The Vulkan docs call for casting this pointer to the function I need. So if I'm 
understanding your email
correctly, I need to prepare a value such that I produce a callout object that 
knows the right signature.
I tried using (cast) and (function-ptr), both of which failed with different 
errors. The SIGSEGV error
came from the (cast) case, which is visible in the source code now a few lines 
above the linked line.

(function-ptr) seemed to produce a callback and not a callout, so it's still 
not useful:

; application: not a procedure;
;  expected a procedure that can be applied to arguments
;   given: #

I understand your point about conversions automatically happening as values pass
across the FFI boundary. But if I can't specify the requested type UNTIL a 
(cast)
and I'm sure the destination signature is correct, then what do I make of the 
SIGSEGV error?

[1]: 
https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L260
[2]: https://stackoverflow.com/a/37900692
[3]: 
https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkGetInstanceProcAddr.html

~slg

‐‐‐ Original Message ‐‐‐
On Thursday, October 24, 2019 8:54 PM, Ryan Culpepper  wrote:

> On 10/25/19 12:45 AM, Sage Gerard wrote:
>
> > I am porting some C++ code to Racket that uses a function pointer.
> > C++ origin: See 294 through 306:
> > https://github.com/Erkaman/vulkan_minimal_compute/blob/master/src/main.cpp#L294
> > Racket destination:
> > https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L240
> > How do I use function-ptr on debug-report-callback to produce a valid
> > function pointer matching this signature
> > https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/PFN_vkDebugReportCallbackEXT.html?
> > My current error comes from line 250, on the expression (function-ptr
> > debug-report-callback _PFN_vkDebugReportCallbackEXT):
> > ; function-ptr: contract violation
> > ;   expected: (and ctype? (lambda (ct) (eq? 'fpointer (ctype->layout ct
> > ;   given: #
> > It seems that my error was that _PFN_vkDebugReportCallbackEXT was
> > (_cpointer/null (_fun ...)), but I am not sure what should take its place.
> >
> > -   If I substitute _fpointer for _PFN_vkDebugReportCallbackEXT, I get
> > the "application; not a procedure" error.
> >
> > -   If I substitute the _fun form with the signature I want, then I get
> > "#->C: argument is not `#' pointer"
> >
> >
> > I suspect this has something to do with the /callout/ concept from the
> > manual, but I don't understand how it applies here.
>
> The use of _cpointer/null seems wrong: its first argument is interpreted
> as a tag, so that's the source of the last error you mentioned. The
> `_cpointer/null` is unnecessary anyway, so just delete it:
>
> (define _PFN_vkDebugReportCallbackEXT (_fun ))
>
> On line 250: I don't think you need to use function-ptr. The field
> setter will automatically convert debug-report-callback (I assume that's
> a Racket procedure) into a callback function pointer.
>
> A callout is a foreign function gets converted into a Racket
> procedure; a callback is when a Racket procedure gets turned into a
> function pointer so it can be called from foreign code. Both are
> described by _fun ctypes.
>
> Here's a simpler example. Suppose you have the following C code:
>
> /* demo.c /
> / gcc -fpic -shared -o demo.so demo.c */
>
> int an_int_fun(int x) {
> return x + 1;
> }
>
> typedef int (*int2int)(int);
>
> int apply_to_twelve(int2int f) {
> return (*f)(12);
> }
>
> struct two_funs {
> int2int f;
> int2int g;
> };
>
> int apply_two_funs_and_sum(struct two_funs *tf, int arg) {
> return (tf->f)(arg) + (tf->g)(arg);
> }
>
> Here Racket bindings for the foreign code:
>
> (require ffi/unsafe ffi/unsafe/define)
> (define-ffi-definer define-demo (ffi-lib "demo.so"))
>
> (define _int2int (_fun _int -&g

[racket-users] Help me understand FFI callouts in this context?

2019-10-24 Thread Sage Gerard
I am porting some C++ code to Racket that uses a function pointer.

C++ origin: See 294 through 306: 
https://github.com/Erkaman/vulkan_minimal_compute/blob/master/src/main.cpp#L294
Racket destination: 
https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L240

How do I use function-ptr on debug-report-callback to produce a valid function 
pointer [matching this 
signature](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/PFN_vkDebugReportCallbackEXT.html)?

My current error comes from line 250, on the expression (function-ptr 
debug-report-callback _PFN_vkDebugReportCallbackEXT):

; function-ptr: contract violation
;   expected: (and ctype? (lambda (ct) (eq? 'fpointer (ctype->layout ct
;   given: #

It seems that my error was that _PFN_vkDebugReportCallbackEXT was 
(_cpointer/null (_fun ...)), but I am not sure what should take its place.

- If I substitute _fpointer for _PFN_vkDebugReportCallbackEXT, I get the 
"application; not a procedure" error.
- If I substitute the _fun form with the signature I want, then I get 
"#->C: argument is not `#' pointer"

I suspect this has something to do with the callout concept from the manual, 
but I don't understand how it applies here.

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/8pQ1Vo6gPYsLf34Uy4IKRsXkFo2CtYfOHGIYT5KBhUPjVx28CCm0Sz1Jz2_S3wfd4ncrEpnKOEjtlKeLxOWCeN5toK0IRtg_Kq6rOKnz1W8%3D%40sagegerard.com.


Re: [racket-users] What's "#"?

2019-10-23 Thread Sage Gerard
Found the issue.

I am populating a 
[VkPhysicalDeviceProperties](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkPhysicalDeviceProperties.html)
 struct. On my system, C reports this structure as 824 bytes. (ctype-sizeof), 
on the other hand, says it's 312. Hardcoding 824 removed the error.

As for how this happened: My generated (define-cstruct) unconditionally 
declared members of struct instance types as pointers to those struct types.

Takeaway for visitors: Verify that sizes are correct by comparing output from 
C's sizeof with Racket's (ctype-sizeof).

~slg

‐‐‐ Original Message ‐‐‐
On Wednesday, October 23, 2019 11:04 AM, Sage Gerard  
wrote:

> Alright, thanks. I have a couple of leads on what happened, but since the 
> implementation details are private I'm unsure of the best troubleshooting 
> technique in this context.
>
> For now I am making a minimal C project that builds a shared library and 
> follows the same allocation pattern and FFI use.
>
> I noticed that switching "_pointer" back to a tagged pointer type makes the 
> program raise an error, but I suspect that's due to a tag being missing from 
> the (malloc) call.
>
> Once I learn my mistake I will share it here.
>
> ~slg
>
>  Original Message 
> On Oct 23, 2019, 10:58 AM, Sam Tobin-Hochstadt < sa...@cs.indiana.edu> wrote:
>
>> `#` is how a representation of one of the internal AST
>> types for the compiler is printed. When you see it, it definitely
>> means some memory got corrupted.
>>
>> Sam
>>
>> On Tue, Oct 22, 2019 at 4:52 PM Sage Gerard  wrote:
>>>
>>> Here's a Vulkan app that prints the properties of the first physical device 
>>> on the system: 
>>> https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L39
>>>
>>> If you comment out the call to `vkGetPhysicalDeviceProperties`, the main 
>>> module works. I create a Vulkan instance, print out a blank version of a 
>>> struct, then destroy the instance. If I leave it in, I get:
>>>
>>> ; ptr-ref: contract violation
>>> ; expected: cpointer?
>>> ; given: #
>>> ; argument position: 1st
>>>
>>> I bind `vkGetPhysicalDeviceProperties` using _pointer so I can learn how to 
>>> work with the raw API:
>>> https://github.com/zyrolasting/racket-vulkan/blob/master/unsafe.rkt#L1008
>>>
>>> I expect I misused a pointer and ended up with corrupted memory. But what 
>>> is #, anyway? How did I produce it?
>>>
>>> ~slg
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to racket-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/kOdM__5k_2CVKSt5cmEUjb8Ci-00MtOsPUnBvetk5puetw-rGEyH95lFrYNQ-rgKdEOJQ7eo7boVEz9ua4RHPeUb1O9OdzsDdkQjwhuM9pA%3D%40sagegerard.com.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/racket-users/jk8PKgoSwaioairnI9lmNa_mZtjRPQ4kEoBgarwc7J6NwKg46Ij2Adz9fNhXPzqTWEwwoY1jS2jxCcYNElmroGGR8vTijVTAKNTjJLMqLdk%3D%40sagegerard.com](https://groups.google.com/d/msgid/racket-users/jk8PKgoSwaioairnI9lmNa_mZtjRPQ4kEoBgarwc7J6NwKg46Ij2Adz9fNhXPzqTWEwwoY1jS2jxCcYNElmroGGR8vTijVTAKNTjJLMqLdk%3D%40sagegerard.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/Qvf3As3o8XZfVDzqxjbotKeij1EeFTzZcPcG8RCcdrY006ZQdTB_EonLLO-xU0wQ6-Bfldte7WHm-c1Hq7EOf9ZTkEZqb0merKX0eRE3CKQ%3D%40sagegerard.com.


Re: [racket-users] What's "#"?

2019-10-23 Thread Sage Gerard
Alright, thanks. I have a couple of leads on what happened, but since the 
implementation details are private I'm unsure of the best troubleshooting 
technique in this context.

For now I am making a minimal C project that builds a shared library and 
follows the same allocation pattern and FFI use.

I noticed that switching "_pointer" back to a tagged pointer type makes the 
program raise an error, but I suspect that's due to a tag being missing from 
the (malloc) call.

Once I learn my mistake I will share it here.

~slg

 Original Message 
On Oct 23, 2019, 10:58 AM, Sam Tobin-Hochstadt wrote:

> `#` is how a representation of one of the internal AST
> types for the compiler is printed. When you see it, it definitely
> means some memory got corrupted.
>
> Sam
>
> On Tue, Oct 22, 2019 at 4:52 PM Sage Gerard  wrote:
>>
>> Here's a Vulkan app that prints the properties of the first physical device 
>> on the system: 
>> https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L39
>>
>> If you comment out the call to `vkGetPhysicalDeviceProperties`, the main 
>> module works. I create a Vulkan instance, print out a blank version of a 
>> struct, then destroy the instance. If I leave it in, I get:
>>
>> ; ptr-ref: contract violation
>> ; expected: cpointer?
>> ; given: #
>> ; argument position: 1st
>>
>> I bind `vkGetPhysicalDeviceProperties` using _pointer so I can learn how to 
>> work with the raw API:
>> https://github.com/zyrolasting/racket-vulkan/blob/master/unsafe.rkt#L1008
>>
>> I expect I misused a pointer and ended up with corrupted memory. But what is 
>> #, anyway? How did I produce it?
>>
>> ~slg
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/kOdM__5k_2CVKSt5cmEUjb8Ci-00MtOsPUnBvetk5puetw-rGEyH95lFrYNQ-rgKdEOJQ7eo7boVEz9ua4RHPeUb1O9OdzsDdkQjwhuM9pA%3D%40sagegerard.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/jk8PKgoSwaioairnI9lmNa_mZtjRPQ4kEoBgarwc7J6NwKg46Ij2Adz9fNhXPzqTWEwwoY1jS2jxCcYNElmroGGR8vTijVTAKNTjJLMqLdk%3D%40sagegerard.com.


[racket-users] What's "#"?

2019-10-22 Thread Sage Gerard
Here's a Vulkan app that prints the properties of the first physical device on 
the system: 
https://github.com/zyrolasting/racket-vulkan/blob/master/examples/mandelbrot.rkt#L39

If you comment out the call to `vkGetPhysicalDeviceProperties`, the main module 
works. I create a Vulkan instance, print out a blank version of a struct, then 
destroy the instance. If I leave it in, I get:

; ptr-ref: contract violation
;   expected: cpointer?
;   given: #
;   argument position: 1st

I bind 
`[vkGetPhysicalDeviceProperties](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkGetPhysicalDeviceProperties.html)`
 using _pointer so I can learn how to work with the raw API:
https://github.com/zyrolasting/racket-vulkan/blob/master/unsafe.rkt#L1008

I expect I misused a pointer and ended up with corrupted memory. But what is 
#, anyway? How did I produce it?

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/kOdM__5k_2CVKSt5cmEUjb8Ci-00MtOsPUnBvetk5puetw-rGEyH95lFrYNQ-rgKdEOJQ7eo7boVEz9ua4RHPeUb1O9OdzsDdkQjwhuM9pA%3D%40sagegerard.com.


Re: [racket-users] How do I represent a convenient two-step allocation using ffi/unsafe?

2019-10-22 Thread Sage Gerard
Hi Matthew,

Wow! Thank you for the detailed response, and the saintly patience behind it.

In following your email, this is the working result after using '_pointer' in 
the function signature:

  (define instance-ptr (malloc _VkInstance))
  (vkCreateInstance instcreateinfo #f instance-ptr)
  (define instance (ptr-ref instance-ptr _VkInstance))
  (vkDestroyInstance instance #f)


My confusion did indeed stem from not understanding how pointer indirection was 
modeled in Racket. I was distracted by questions like "What's the address-of 
operator equivalent?" while staring at the arguments to the wrapper procedures.

I still prefer this form for the unsafe layer because of its faithful 
representation of Vulkan. This is not at all to discount your advice for using 
_ptr as the best working translation. The spec supports a view where I can 
generate a second layer of helpful wrapper procedures that use the first, as 
opposed to generating the most tailored wrapper procedure at the first 
oppurtunity.

Thank you again. I know you didn't have to take the time, so it means a lot to 
me that you did. Hopefully I won't end up confused again. :)

~slg

‐‐‐ Original Message ‐‐‐
On Tuesday, October 22, 2019 9:28 AM, Matthew Flatt  wrote:

 The short answer is: `(_ptr io _VkInstance)` does not mean that a
 pointer to a `_VkInstance` happens on the Racket side. It means that a
 `_VkInstance` (not a pointer to a `_VkInstance`) happens on the Racket
 side, and a pointer to a `_VkInstance` happens on the C side.

 Taking it from the top:

 At Mon, 21 Oct 2019 19:07:40 +0000, Sage Gerard wrote:

  (define _VkInstance (_cpointer 'VkInstance_T))

 So far, so good.`VkInstance` is defined in Vulkan to be a pointer to
 unspecified memory, so this makes sense.

 To be clear,

 (malloc _VkInstance)

 does not create a `_VkInstance`. It creates a pointer to a
 `_VkInstance` (i.e., a pointer to a pointer). That could be what you
 want, depending on how `vkCreateInstance` is defined. Specifically, to
 make this work:

 (define instance-ptr (malloc _VkInstance))

 (vkCreateInstance instcreateinfo #f instance-ptr)

 (define created-instance (ptr-ref instance-ptr _VkInstance))

 Define `vkCreateInstance` like this:

 (define-vulkan vkCreateInstance
 (_fun _VkInstanceCreateInfo-pointer/null
 _VkAllocationCallbacks-pointer/null
 _pointer ; to a _VkInstance
 - (r : _VkResult)

   - (check-vkResult r 'vkCreateInstance)))


 I've written the third type as just`_pointer` because there's not a
 simple way to say "pointer to a `_VkInstance`". There's no way to write
 that because it would offer no more checking than just `_pointer`. It
 might be a little better to write the comment as a `define`:

 (define _VkInstance-pointer _pointer)

 (define-vulkan vkCreateInstance
 (_fun _VkInstanceCreateInfo-pointer/null
 _VkAllocationCallbacks-pointer/null
 _VkInstance-pointer
 - (r : _VkResult)

   - (check-vkResult r 'vkCreateInstance)))


 You could go further and write

 ;; pointer to a `_VkInstance`:
 (define _VkInstance-pointer (_cpointer 'VkInstance_T*))

 (define-vulkan vkCreateInstance
 (_fun _VkInstanceCreateInfo-pointer/null
 _VkAllocationCallbacks-pointer/null
 _VkInstance-pointer
 - (r : _VkResult)

   - (check-vkResult r 'vkCreateInstance)))


 (define instance-ptr (malloc _VkInstance))
 (cpointer-push-tag! instance-ptr 'VkInstance_T*)
 (vkCreateInstance instcreateinfo #f instance-ptr)
 (define created-instance (ptr-ref instance-ptr _VkInstance))

 That's probably more trouble than it's worth, and the checking benefits
 depend on `malloc` and `cpointer-push-tag!` begin used consistently
 together. Declaring `_VkInstance-pointer` could make sense if the
 library provides a `make-VkInstance-pointer` function to combine the
 `malloc` and `cpointer-push-tag!` steps, helping to make sure they're
 always consistent.

 Instead of `_pointer` or `_VkInstance-pointer`, you've written

 (_ptr io _VkInstance)

 As an argument type, that means:

 -   The caller supplies a `_VkInstance` (not a pointer to a `VkInstance`).

 -   Fresh memory for a `_VkInstance` is allocated.

 -   The given `_VkInstance` is copied into the fresh memory.

 -   The address of the fresh memory is passed to the foreign function as
 a pointer to a `_VkInstance`.

 So, you're seeing an error because `(malloc _VkInstance)` does not
 create a `_VkInstance`. Anyway, this is not what you want, because
 `vkCreateInstance` would set the pointer at the fresh memory, which is
 then discarded.

 Generally, a `(_ptr io ...)` argument without a name binding doesn't
 make any sense --- unless you really want to ignore the result (which
 you don't, in this case).

 It's pretty typical for "middleware" layers like the FFI to take into
 account the in--out behavior of function arguments, and that's why many
 C prototype descriptions are augmented with that information. The
 `ffi/uns

Re: [racket-users] Re: I Need Help Bringing Vulkan to Racket

2019-10-21 Thread Sage Gerard
Yes, see 
https://github.com/zyrolasting/racket-vulkan/blob/master/examples/minimal.rkt

~slg

 Original Message 
On Oct 21, 2019, 6:17 PM, Hendrik Boom wrote:

> On Mon, Oct 21, 2019 at 07:42:39PM +0000, Sage Gerard wrote:
>> Thanks Paulo, I will follow up off-list.
>>
>> On-list: The bindings are now functional for the simplest possible Vulkan 
>> instance
>> lifecycle (create, destroy, end of process).
>
> Does that mean there is something to test already, however trivial?
> Can i try this test on my machine?
>
> (I know nothing about Vulkan and have never used it directly, but I think I 
> installed it
> on my Devuan Linux system.)
>
>> I'm having trouble learning how to create
>> wrapper procedures that do not behave any differently from underlying C 
>> functions.
>> Relevant user list thread:
>> https://www.mail-archive.com/racket-users@googlegroups.com/msg42764.html
>>
>> Until that's figured out, nothing using two-step allocations using the same 
>> function will work (e.g. device enumeration, queue feature detection).
>>
>> With luck, this is the last hurdle to writing a non-trivial application and 
>> getting more people involved.
>>
>> ~slg
>>
>> ‐‐‐ Original Message ‐‐‐
>> On Monday, October 21, 2019 11:18 AM, Paulo Matos  wrote:
>>
>> > On Wednesday, 9 October 2019 22:56:48 UTC+2, Sage Gerard wrote:
>> >
>> >> I'm resuming work on a very early-stage project that generates FFI 
>> >> bindings for Vulkan in Racket [1]. VkTk is the closest relative project I 
>> >> have found for reference [2].
>> >>
>> >> Last time I was on the project I was focused on generating bindings from 
>> >> the API registry. That has not changed. I considered use of Dave Herman's 
>> >> C library [3] on vulkan.h directly, but the XML spec has supplemental 
>> >> data, and vulkan.h has preprocessor directives that I would like to 
>> >> capture for completeness.
>> >>
>> >> Once I am finished with the bindings. would anyone be available to 
>> >> contribute/run tests in the hopes that we can make this viable faster? I 
>> >> intend to run any applications on Windows 10 and a 1080Ti, but that's 
>> >> about all of the configurations that I can verify. I'll definitely need 
>> >> guinea pigs and feedback.
>> >
>> > Hi Sage,
>> >
>> > Thanks for this effort.
>> > I have a large machine - currently used for Racket CI, which could be used 
>> > for running these tests as well. A separate machine specifically for 
>> > benchmarking is available as well.
>> > Give me a pvt. shout to arrange this.
>> >
>> > Paulo
>> >
>> >> [1]: https://github.com/zyrolasting/racket-vulkan
>> >> [2]: https://github.com/awolven/VkTk
>> >> [3]: https://docs.racket-lang.org/c-utils/index.html
>> >>
>> >> ~slg
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Racket Users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an 
>> > email to racket-users+unsubscr...@googlegroups.com.
>> > To view this discussion on the web visit 
>> > [https://groups.google.com/d/msgid/racket-users/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com?utm_medium=email_source=footer).
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/VPgfhdDOjHzoxPz1iIZBQFViGpcabLvrCTvnStrSlCMrbSN6sjdvmldu3JPwCZEg0FS8IcjUxcNYlxN5VhUWWG7Jv4aHHkMMHPdVWp3LuOM%3D%40sagegerard.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/20191021221758.zgifjnokcw6xbnq3%40topoi.pooq.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/0FFGPcDe7OBBMATEKDU6pcKeRM-kPJiI3SHllAIptw6HIIlW0TnjYVXdFkZaSZcmaTai-I9SBOt2io6pji3yfhmnKTuPpKuhtnfJbPl8_GM%3D%40sagegerard.com.


Re: [racket-users] Re: I Need Help Bringing Vulkan to Racket

2019-10-21 Thread Sage Gerard
Thanks Paulo, I will follow up off-list.

On-list: The bindings are now functional for the simplest possible Vulkan 
instance lifecycle (create, destroy, end of process). I'm having trouble 
learning how to create wrapper procedures that do not behave any differently 
from underlying C functions. Relevant user list thread: 
https://www.mail-archive.com/racket-users@googlegroups.com/msg42764.html

Until that's figured out, nothing using two-step allocations using the same 
function will work (e.g. device enumeration, queue feature detection).

With luck, this is the last hurdle to writing a non-trivial application and 
getting more people involved.

~slg

‐‐‐ Original Message ‐‐‐
On Monday, October 21, 2019 11:18 AM, Paulo Matos  wrote:

> On Wednesday, 9 October 2019 22:56:48 UTC+2, Sage Gerard wrote:
>
>> I'm resuming work on a very early-stage project that generates FFI bindings 
>> for Vulkan in Racket [1]. VkTk is the closest relative project I have found 
>> for reference [2].
>>
>> Last time I was on the project I was focused on generating bindings from the 
>> API registry. That has not changed. I considered use of Dave Herman's C 
>> library [3] on vulkan.h directly, but the XML spec has supplemental data, 
>> and vulkan.h has preprocessor directives that I would like to capture for 
>> completeness.
>>
>> Once I am finished with the bindings. would anyone be available to 
>> contribute/run tests in the hopes that we can make this viable faster? I 
>> intend to run any applications on Windows 10 and a 1080Ti, but that's about 
>> all of the configurations that I can verify. I'll definitely need guinea 
>> pigs and feedback.
>
> Hi Sage,
>
> Thanks for this effort.
> I have a large machine - currently used for Racket CI, which could be used 
> for running these tests as well. A separate machine specifically for 
> benchmarking is available as well.
> Give me a pvt. shout to arrange this.
>
> Paulo
>
>> [1]: https://github.com/zyrolasting/racket-vulkan
>> [2]: https://github.com/awolven/VkTk
>> [3]: https://docs.racket-lang.org/c-utils/index.html
>>
>> ~slg
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/9ee51764-bbbe-4328-8d04-8a3d18a65649%40googlegroups.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/VPgfhdDOjHzoxPz1iIZBQFViGpcabLvrCTvnStrSlCMrbSN6sjdvmldu3JPwCZEg0FS8IcjUxcNYlxN5VhUWWG7Jv4aHHkMMHPdVWp3LuOM%3D%40sagegerard.com.


Re: [racket-users] How do I represent a convenient two-step allocation using ffi/unsafe?

2019-10-21 Thread Sage Gerard
Thank you for taking the time. I am following you well enough, but I'm having
trouble applying your advice. I'll use a different function to hopefully 
simplify the discussion.

typedef VkInstance_T* VkInstance;

VkInstance instance;
vkCreateInstance(, NULL, ) // assume createInfo is defined

VkInstance_T is private. It's allocated in the implementation of 
[vkCreateInstance](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/vkCreateInstance.html)
as a side-effect. In Racket, I want the code to look and behave as much like 
that as possible,
even if it means the instance is not allocated for me, or returned from the 
wrapper
function.

As per your advice I changed the wrapper procedure to use (_ptr io ___). 
However, I did not bind it to an identifier.
I'm hoping to maintain the same arity as the C function, declare the instance 
in client code, and have it populated
by side-effect as in the C.

(define _VkInstance (_cpointer 'VkInstance_T))
(define-vulkan vkCreateInstance
   (_fun _VkInstanceCreateInfo-pointer/null
 _VkAllocationCallbacks-pointer/null
 (_ptr io _VkInstance)
 -> (r : _VkResult)
 -> (begin (check-vkResult r (quote vkCreateInstance)

And, based on your email, I tried allocating the pointer and assuming that the 
wrapper procedure
would use the address of the pointer for me (That's what I guessed was 
happening when you passed `0` across (_ptr io _uint32_t) earlier).

(define instance (malloc _VkInstance))
(vkCreateInstance instcreateinfo #f instance)

But this produces "VkInstance_T->C: argument is not non-null `VkInstance_T' 
pointer".
I reproduce that exact error even if I replace (_ptr io _VkInstance) with just 
_pointer, and use cpointer-push-tag!

What do I have to do to make this example work? If I can just understand that, 
I can bring that back to the prior example.

~slg

‐‐‐ Original Message ‐‐‐
On Sunday, October 20, 2019 7:24 PM, Matthew Flatt mfl...@cs.utah.edu wrote:

> At Sun, 20 Oct 2019 23:07:58 +, Sage Gerard wrote:
>
>> So if I take the vkEnumerateInstanceLayerProperties/private you showed me
>> and change the (_ptr io _uint32_t) to (_cpointer _uint32_t), will it have any
>> other noticeable usability differences for someone thinking like a C
>> programmer? Do I have to use _ptr at all to do what I intend to do?
>
> You don't have to use_ptr, but (_cpointer _uint32_t) is awkward,
> because it requires that the allocated pointer is tagged using
> _uint32_t. Then, instead of just
> (malloc _uin32_t)
> a client would have to write
> (let ([p (malloc _uint32_t)])
> (cpointer-push-tag! p _uint32_t)
> p)
> To expose the raw API without _ptr, I'd just use _pointer.
> If possible, using _ptr is the right way to expose this function
> without trying to provide a higher-level interface:
> (define-vulkan vkEnumerateInstanceLayerProperties
> (_fun (o0 : (_ptr io _uint32_t))
> _pointer
> -> (r : _VkResult)
>
> -> (begin
>
>   (check-vkResult r 'vkEnumerateInstanceLayerProperties)
>   o0)))
>
> I don't know if the information you're working with lends itself to
> generating that kind of view, though, which would mean describing the
> first argument is an in--out uint32_t.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/d0612-WaxmrOnMHAwXebVpKiSYKDomEnyqox2z1yQyY5EVYeLx-0a-shqIrDqHcoAWKoKvpC7QGMhjTU-5tzp5zNCqrRDgb6rAZecHKtBOk%3D%40sagegerard.com.


Re: [racket-users] How do I represent a convenient two-step allocation using ffi/unsafe?

2019-10-20 Thread Sage Gerard
Hi Matthew,

That makes sense, thanks. I have a follow-up question, and forgive me for the 
180-degree turn.

I realized I was wrong to convey that I want the wrapper functions to help with 
allocations. My situation is that I have 346 generated procedure bindings for 
Vulkan, and 1342 bindings total. The more "helpful" the bindings I generate, 
the more differences I have to document, the more corner cases I have to 
support in the code generator, and the higher the learning curve for my users. 
I think it would be wiser to keep the bindings entirely consistent with their C 
equivalents and hand-write helpers on top to capture common patterns.

So if I take the `vkEnumerateInstanceLayerProperties/private` you showed me and 
change the (_ptr io _uint32_t) to (_cpointer _uint32_t), will it have any other 
noticeable usability differences for someone thinking like a C programmer? Do I 
have to use _ptr at all to do what I intend to do?

~slg

‐‐‐ Original Message ‐‐‐
On Sunday, October 20, 2019 9:10 AM, Matthew Flatt mfl...@cs.utah.edu wrote:

> I don't think `ffi/unsafe` can generate that kind of wrapper for you.
> I'd write something like this:
> (define-vulkan vkEnumerateInstanceLayerProperties/private
> (_fun (o0 : (_ptr io _uint32_t))
> _pointer
> -> (r : _VkResult)
>
>  -> (begin
>
>   (check-vkResult r 'vkEnumerateInstanceLayerProperties)
>   o0))
>
>
> #:c-id vkEnumerateInstanceLayerProperties)
> (define (vkEnumerateInstanceLayerProperties)
> (define len (vkEnumerateInstanceLayerProperties/private 0 #f))
> (define props (malloc _VkLayerProperties len))
> (define new-len (vkEnumerateInstanceLayerProperties/private len props))
> (values new-len props))
> At Sun, 20 Oct 2019 03:47:52 +, Sage Gerard wrote:
>
> > Consider the following C++ that calls a function once to learn how much it
> > should allocate for a vector, and again to populate said vector.
> > uint32_t count;
> > vkEnumerateInstanceLayerProperties(, NULL);
> > std::vector properties(count);
> > vkEnumerateInstanceLayerProperties(, properties.data());
> > Below is my generated signature so far. The docs for
> > [_list](https://docs.racket-lang.org/foreign/foreign_procedures.html?q=fun#(
> > form.%28%28lib._ffi%2Funsafe..rkt%29.__list%29%29) shows similar 
> > examples,but they assume either the length of the vector is known in 
> > advance.
> > How would I make a custom function type to manage both o1 and o0 values with
> > the garbage collector, call the function twice as described, and return the
> > value for o1 in a single call?
> > (define-vulkan vkEnumerateInstanceLayerProperties
> > (_fun (o0 : (_ptr o _uint32_t))
> > (o1 : (_ptr o _VkLayerProperties))
> > -> (r : _VkResult)
> > -> (begin (check-vkResult r (quote vkEnumerateInstanceLayerProperties))
> > (values o0 o1
> > ~slg
> >
> > ---
> >
> > You received this message because you are subscribed to the Google Groups
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/racket-users/Vo2OHZYjsSlsnJojlfmw5yolaYJWQzql
> > unk7S24hrnFb4Lk1jz0kqe2RCGM_aPFXxeVQfRqDPM2p7GKeN_drxRoi2Q9ZGu2srPhAme7LCAk%3D%
> > 40sagegerard.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/uve4UrxotdFfO-qPP633LXmJHb-OLnhG9iSwyZ2Cf3Lck9P6OcmxKFGzoG0VkzNQHKXesDMV6nRwOX72kNWStmUrLGkFAUQ2wX2wgtqvheo%3D%40sagegerard.com.


[racket-users] How do I represent a convenient two-step allocation using ffi/unsafe?

2019-10-19 Thread Sage Gerard
Consider the following C++ that calls a function once to learn how much it 
should allocate for a vector, and again to populate said vector.

uint32_t count;

vkEnumerateInstanceLayerProperties(, NULL);

std::vector properties(count);

vkEnumerateInstanceLayerProperties(, properties.data());

Below is my generated signature so far. The docs for 
[_list](https://docs.racket-lang.org/foreign/foreign_procedures.html?q=_fun#%28form._%28%28lib._ffi%2Funsafe..rkt%29.__list%29%29)
 shows similar examples, but they assume either the length of the vector is 
known in advance.

How would I make a custom function type to manage both o1 and o0 values with 
the garbage collector, call the function twice as described, and return the 
value for o1 in a single call?

(define-vulkan vkEnumerateInstanceLayerProperties
  (_fun (o0 : (_ptr o _uint32_t))
(o1 : (_ptr o _VkLayerProperties))
-> (r : _VkResult)
-> (begin (check-vkResult r (quote vkEnumerateInstanceLayerProperties))
  (values o0 o1

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/Vo2OHZYjsSlsnJojlfmw5yolaYJWQzqlunk7S24hrnFb4Lk1jz0kqe2RCGM_aPFXxeVQfRqDPM2p7GKeN_drxRoi2Q9ZGu2srPhAme7LCAk%3D%40sagegerard.com.


[racket-users] Vulkan integration ready for first round of testing

2019-10-18 Thread Sage Gerard
I think I'm ready to do my first rounds writing/supporting Vulkan applications. 
It would not surprise me if some design gaps pop up, but I think we're in a 
good spot.

Source code: https://github.com/zyrolasting/racket-vulkan/
Write up: https://sagegerard.com/racket-vulkan-before-testing.html

I'm starting by writing an app on Linux. I'll then try to run the exact same 
code on Windows. My ability to test cross-platform is limited beyond that, so 
if you are interested in this project, please try it and report any bugs. You 
should be able to try Android, Metal, etc.

General feedback is, as always, deeply appreciated.

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/H7XbzFjibEoG22p5bUgpgHZDQGExctOU0I0rl5lBvqBt5ZjJrTWkQ4g6GOiyJJvKF2Ht4rFy3lOzw6uKnoxT3gkO292m1P9gDzA1hM1CPaU%3D%40sagegerard.com.


[racket-users] Seeking feedback on Vulkan integration progress

2019-10-17 Thread Sage Gerard
I finished generating C enums, bitsets, function pointers, structs, unions and 
handle declarations from the Vulkan API registry. I wrote an article on the 
topic with a link to the current output module [1].

I tried using dynamic-ffi but hit an issue re: header selection that I expect 
will be resolved [2]. I still intend to include use of it for those who prefer 
its interface. My intended experience is for (require vulkan/unsafe) to include 
Vulkan C-types into the module namespace.

I'd like to ask anyone interested in this project and with Vulkan/FFI 
experience to review the output code linked in the article and point out any 
erroneous patterns. Since I'm learning ffi/unsafe as I go, I expect I've done a 
few things wrong, or inefficiently. I'd want to know that sooner rather than 
later.

I hope to be test-ready by end of next week. After that comes extension 
support, and finally porting @Erkaman's Mandelbrot set renderer to implement 
the first test [3].

~slg

[1]: https://sagegerard.com/racket-vulkan-types-done.html
[2]: https://github.com/dbenoit17/dynamic-ffi/issues/27
[3]: https://github.com/Erkaman/vulkan_minimal_compute

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/ZhQGm7uHROBBlq-5Ff7WiItvvS-SeDeqNlwZMWmKWIReDK-9viFg_5RhdHDVGFzJs5QVGexdIRZ-YNhvL5wd0NJrvBo8cR0IjZV6kC-M5_s%3D%40sagegerard.com.


[racket-users] regexp-match + REPL leads to confusing output

2019-10-16 Thread Sage Gerard
I'd like to understand the reader better, and this seems relevant to it. In 
this REPL session I do not escape \S with a second \ in the first interaction. 
After I introduce the slash later, the REPL never really "recovers." Even a 
simple (displayln) stops producing output.

What's happening?

Welcome to Racket v7.4.

> (regexp-match #rx"typedef (\S+)" "typedef void ()")

; readline-input:1:14: read-syntax: unknown escape sequence `\S` in string [,bt

;   for context]

#

; readline-input:1:30: read-syntax: unexpected `)` [,bt for context]

" "

; typedef: undefined;

;  cannot reference an identifier before its definition

;   in module: top-level

; [,bt for context]

#

; readline-input:1:47: #%app: missing procedure expression;

;  probably originally (), which is an illegal empty application

;   in: (#%app)

; [,bt for context]

> (regexp-match #rx"typedef (\\S+)" "typedef void ()")

")\n(regexp-match #rx"

; typedef: undefined;

;  cannot reference an identifier before its definition

;   in module: top-level

; [,bt for context]

; |\S+|: undefined;

;  cannot reference an identifier before its definition

;   in module: top-level

; [,bt for context]

" "

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/wSywBnnCjlkGYj8831CE3ZvQbuMZRAtB3UIz-4hl1yKQiCdQLFVJjm_KXX5qOm0CwHO9YC1Q0y_6wVS8BJu-YNXWFRKe1IwgCiA6v8LPN1s%3D%40sagegerard.com.


Re: [racket-users] I Need Help Bringing Vulkan to Racket

2019-10-14 Thread Sage Gerard
Thanks for the advice, Jay.

I installed dynamic-ffi and could not get the initial example to work, 
presumably due to my own error: 
https://github.com/dbenoit17/dynamic-ffi/issues/25

~slg

‐‐‐ Original Message ‐‐‐
On Wednesday, October 9, 2019 6:36 PM, Jay McCarthy  
wrote:

> Hi Sage,
>
> You should model your implementation of Stephan's RacketGL --- 
> https://github.com/stephanh42/RacketGL --- which parses the spec.
>
> If you also want to or need to capture parts of the headers, I recommend 
> David Benoit's dynamic-ffi --- https://github.com/dbenoit17/dynamic-ffi --- 
> for parsing them with Clang's library, rather than going with something home 
> grown.
>
> I am very interested in making mode-lambda work on Vulkan. I have a Windows 
> computer that I could test on.
>
> Jay
>
> --
> Jay McCarthy
> Associate Professor @ CS @ UMass Lowell
> http://jeapostrophe.github.io
> Vincit qui se vincit.
>
> On Thu, Oct 10, 2019 at 5:56 AM Sage Gerard  wrote:
>
>> I'm resuming work on a very early-stage project that generates FFI bindings 
>> for Vulkan in Racket [1]. VkTk is the closest relative project I have found 
>> for reference [2].
>>
>> Last time I was on the project I was focused on generating bindings from the 
>> API registry. That has not changed. I considered use of Dave Herman's C 
>> library [3] on vulkan.h directly, but the XML spec has supplemental data, 
>> and vulkan.h has preprocessor directives that I would like to capture for 
>> completeness.
>>
>> Once I am finished with the bindings. would anyone be available to 
>> contribute/run tests in the hopes that we can make this viable faster? I 
>> intend to run any applications on Windows 10 and a 1080Ti, but that's about 
>> all of the configurations that I can verify. I'll definitely need guinea 
>> pigs and feedback.
>>
>> [1]: https://github.com/zyrolasting/racket-vulkan
>> [2]: https://github.com/awolven/VkTk
>> [3]: https://docs.racket-lang.org/c-utils/index.html
>>
>> ~slg
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/racket-users/RsANZblSLyJViX1EDgDg-umCCJKCS6uYV84htPiRjjgAuW7G_3nx-fAOrLD7VMDqtEDkSKbm16jPyTWsAk1QyXCF8cz2CUi-mP04jrpmgn8%3D%40sagegerard.com](https://groups.google.com/d/msgid/racket-users/RsANZblSLyJViX1EDgDg-umCCJKCS6uYV84htPiRjjgAuW7G_3nx-fAOrLD7VMDqtEDkSKbm16jPyTWsAk1QyXCF8cz2CUi-mP04jrpmgn8%3D%40sagegerard.com?utm_medium=email_source=footer).
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/CAJYbDa%3DotA_tNaD1troPWF9XDoj_hg0dMKKpiR1xQV%2BKMip%2BHQ%40mail.gmail.com](https://groups.google.com/d/msgid/racket-users/CAJYbDa%3DotA_tNaD1troPWF9XDoj_hg0dMKKpiR1xQV%2BKMip%2BHQ%40mail.gmail.com?utm_medium=email_source=footer).

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/eO91JW6_IYvYy30i5nyeKkHGg0Kgha4MVl96Kyek5fBsxydUdR9IBxXJUCV6i7So1Y2ELZ26qkYNSkRMz2qR-l341y-nOOQYxPq9Epuk_OQ%3D%40sagegerard.com.


[racket-users] polyglot update + new search-upwards package

2019-10-11 Thread Sage Gerard
Giving away some more code.

- polyglot is now version 1.0. Includes a new functional workflow where 
Markdown+Racket pages can replace themselves entirely [1]. The public API now 
includes the means to evaluate Racket modules stored in tagged x-expressions 
(Thanks to Paulo Matos for the suggestion). I'm really excited about where this 
project is going!
- New package: search-upward [2]. The use case is finding specialized rcfiles 
or directories like `node_modules` while walking towards the root directory.

[1]: https://docs.racket-lang.org/polyglot/functional-workflow.html?q=polyglot
[2]: https://pkgd.racket-lang.org/pkgn/package/search-upward
~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/2_VEpQGEqnFR9kJ64P_wTRyIkfKjzz7bQpvOqUFrnxuvvc0-96Z996W6hapjCgeR57QKBwEUBG_f1x-CgcscGf6iKJ_KceJTsMZptAuiFUE%3D%40sagegerard.com.


Re: [racket-users] How do I typeset mixed-code for docs.racket-lang.org?

2019-10-09 Thread Sage Gerard
Hi William,

Sorry for the delay and thank you for responding so quickly.

It's a night and day difference in terms of presentation. I don't see 
documentation links functioning (e.g. the "displayln" in your example). I'm 
assuming that since @minted only applies to styles, it will function fine if 
composed with @racketmod and friends?


~slg

‐‐‐ Original Message ‐‐‐
On Tuesday, October 8, 2019 3:05 PM, William J. Bowman 
 wrote:

> This got me interested.
> I tried a quick hack on my scribble-minted package to allow for nesting
> different languages.
> Is this something like what you want?
> https://www.williamjbowman.com/tmp/scribble-minted/nested.html
>
> Source here:
> https://github.com/wilbowma/scribble-minted/tree/nested-minted/nested.scrbl
>
> 
>
> William J. Bowman
>
> On Tue, Oct 08, 2019 at 05:06:40PM +, Sage Gerard wrote:
>
> > One of my projects allows for embedding Racket modules within  
> > elements, within a Markdown page.
> >
> > Hello World
> >
> > 
> >
> > <script type="application/racket">
> > #lang racket/base
> > ...
> > 
> > In my scribble manual, I want to typeset code examples that look like that 
> > and have it look decent. Here's what I tried:
> >
> > -   I wrapped the whole thing in @verbatim. Easiest to do, but has no 
> > linking or syntax highlighting.
> > -   Wrapping everything before a Racket block in @verbatim and wrapping the 
> > Racket code in @racketmod. Better, but there's a dotted line to the left of 
> > only the Racket code. That, and I don't see an obvious way to control 
> > indentation of Racket blocks within a larger code block.
> > -   I used just @racketmod with #:file "

[racket-users] I Need Help Bringing Vulkan to Racket

2019-10-09 Thread Sage Gerard
I'm resuming work on a very early-stage project that generates FFI bindings for 
Vulkan in Racket [1]. VkTk is the closest relative project I have found for 
reference [2].

Last time I was on the project I was focused on generating bindings from the 
API registry. That has not changed. I considered use of Dave Herman's C library 
[3] on vulkan.h directly, but the XML spec has supplemental data, and vulkan.h 
has preprocessor directives that I would like to capture for completeness.

Once I am finished with the bindings. would anyone be available to 
contribute/run tests in the hopes that we can make this viable faster? I intend 
to run any applications on Windows 10 and a 1080Ti, but that's about all of the 
configurations that I can verify. I'll definitely need guinea pigs and feedback.

[1]: https://github.com/zyrolasting/racket-vulkan
[2]: https://github.com/awolven/VkTk
[3]: https://docs.racket-lang.org/c-utils/index.html

~slg

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/RsANZblSLyJViX1EDgDg-umCCJKCS6uYV84htPiRjjgAuW7G_3nx-fAOrLD7VMDqtEDkSKbm16jPyTWsAk1QyXCF8cz2CUi-mP04jrpmgn8%3D%40sagegerard.com.


[racket-users] How do I typeset mixed-code for docs.racket-lang.org?

2019-10-08 Thread Sage Gerard
One of my projects allows for embedding Racket modules within  
elements, within a Markdown page.

## Hello World