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

[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

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

2019-10-30 Thread Sage Gerard
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` t

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

2019-10-27 Thread Sage Gerard
, 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 > la

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 a

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.

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

2019-10-24 Thread Sage Gerard
try/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. >

[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

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

2019-10-23 Thread Sage Gerard
‐‐‐ 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

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

2019-10-23 Thread Sage Gerard
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: >> >> Her

[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,

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

2019-10-22 Thread Sage Gerard
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. T

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. >

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

2019-10-21 Thread Sage Gerard
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 g

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

2019-10-21 Thread Sage Gerard
e 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 wr

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

2019-10-20 Thread Sage Gerard
> #: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)

[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());

[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

[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

[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?

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

2019-10-14 Thread Sage Gerard
or @ 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

[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

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

2019-10-09 Thread Sage Gerard
ed/tree/nested-minted/nested.scrbl > > > > William J. Bowman > > On Tue, Oct 08, 2019 at 05:06:40P

[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

[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