Re: [racket-users] scribble/srcdoc raised exception fix and class-doc syntax form

2019-09-27 Thread Dominik Pantůček
Hi, On 25. 09. 19 19:43, Dominik Pantůček wrote: > > On 25. 09. 19 19:32, Ben Greenman wrote: >>> Should I include a brief documentation in >>> scribble-doc/scribblings/scribble/srcdoc.scrbl within the same PR as well? >> >> Yes! > > Btw, looking at t

[racket-users] Vector lenght and indices contracts

2019-12-04 Thread Dominik Pantůček
Hello, looking at vector-length[1] documentation, it returns (exact-nonnegative-integer?). However, as far as I can tell, it returns (fixnum?). Also for subsequent contracts in the vector's documentation all indices are assumed to be (exact-nonnegative-integer?) but usually it is impossible on

Re: [racket-users] Vector length and indices contracts

2019-12-04 Thread Dominik Pantůček
On 04. 12. 19 20:21, Matthew Flatt wrote: > I think it makes sense to refine the contract to guarantee a fixnum > result for `vector-length`. > > This fact is currently documented in `unsafe-vetcor-length`, because > that's the layer where it has seemed sensible to talk about fixnums in > the

Re: [racket-users] Re: Inadvertedly requiring racket/unsafe/ops

2019-12-15 Thread Dominik Pantůček
me. Also it is nice - if you are in need of heavy optimizations - to see the list of unsafe ops in one place. Cheers, Dominik > > On Saturday, December 14, 2019 at 1:03:14 PM UTC-8, Dominik Pantůček > wrote: > > Hello, > > the documentation at > https://docs.racket-lan

[racket-users] futures-sort update

2019-12-07 Thread Dominik Pantůček
Hello Racketeers, I am continuing my work on cleaning up our private source code and publishing it as a part of my futures-sort[1] package. Current state of the package is: - configurable parallelism depth - in-place parallel merge-sort of both vector and fxvector - parallel merge-sort with

[racket-users] Inadvertedly requiring racket/unsafe/ops

2019-12-14 Thread Dominik Pantůček
Hello, the documentation at https://docs.racket-lang.org/reference/fixnums.html is misleading at best. If you - as I did - use the suggested approach of requiring optimized (and unsafe) fx... operations from racket/unsafe/ops with: (require (filtered-in (λ (name) (regexp-replace

Re: [racket-users] question re downloading a PDF file

2019-11-24 Thread Dominik Pantůček
Hi, On 24. 11. 19 13:01, Tim Hanson wrote: > hi, > > I need to fetch a number of PDF documents and wrote a bit of racket to make > it easier. The part that "downloads" is this: > > (let ([content >((compose port->string get-pure-port string->url) (url-for-doc > year

[racket-users] scribble/srcdoc raised exception fix and class-doc syntax form

2019-09-25 Thread Dominik Pantůček
Hello, as a heavy user of scribble/srcdoc I've always missed a defclass provide form equivalent. Therefore I wanted to implement my own. I decided to use thing-doc as a starting point and noticed that it raises misleading message if id is not an identifier. Minimal working example follows.

Re: [racket-users] scribble/srcdoc raised exception fix and class-doc syntax form

2019-09-25 Thread Dominik Pantůček
Hi, thank you for the quick response. On 25. 09. 19 17:11, Ben Greenman wrote: > These changes look great. Can you open a pull request for the > racket/scribble repo? > opened PR#212. > It looks like: > - `class?` would be a better contract than `any/c` Definitely makes sense, as the result

Re: [racket-users] scribble/srcdoc raised exception fix and class-doc syntax form

2019-09-25 Thread Dominik Pantůček
On 25. 09. 19 19:32, Ben Greenman wrote: >> Should I include a brief documentation in >> scribble-doc/scribblings/scribble/srcdoc.scrbl within the same PR as well? > > Yes! Btw, looking at the struct-doc and struct*-doc descriptions maybe I should actually provide class-doc and class*-doc

[racket-users] Parallel merge-sort leveraging futures

2019-10-07 Thread Dominik Pantůček
Hello, over the course of past few months I have been tasked with solving a (real-world) problem of sorting the sums of all possible combinations of numbers. Some boring accounting stuff revolving around invoices. As the total number of combinations is 2^N where N is the number of source numbers,

Re: [racket-users] Re: Parallel merge-sort leveraging futures

2019-10-08 Thread Dominik Pantůček
Hi, On 08. 10. 19 6:58, Sam Tobin-Hochstadt wrote: > I've submitted a pull request fixing those errors and supporting > running in serial mode. thank you for that, it's already fixed. I am actually pulling this from our internal git repository and I imported older info.rkt into the Github one.

Re: [racket-users] Re: Parallel merge-sort leveraging futures

2019-10-10 Thread Dominik Pantůček
Hello, thanks everyone for helping me putting this into a reasonable shape. My short-term plans with futures-sort are currently to check how various construct could be improved (or'ing of touched futures is really just a quick hack for example). Also I'd like to investigate why it didn't work

[racket-users] Proxying websockets via web-server

2020-01-09 Thread Dominik Pantůček
Hello everyone, I am working on an application that uses React.js[1] for front-end and Racket as HTTP back-end server. For production builds, the Javascript part is compiled using "npm build" which generates a directory full of HTML and Javascript files which are then included in the Racket

Re: [racket-users] Proxying websockets via web-server

2020-01-12 Thread Dominik Pantůček
d then use > normal inter-Racket communication like channels and stuff to work with > the rest of your Web application? > > Jay > > -- > Jay McCarthy > Associate Professor @ CS @ UMass Lowell > http://jeapostrophe.github.io > Vincit qui se vincit. > > On Thu, Ja

Re: [racket-users] Re: Inadvertedly requiring racket/unsafe/ops

2019-12-23 Thread Dominik Pantůček
k that this might be good to fix as well. Cheers, Dominik [1] https://github.com/racket/racket/pull/2975 On 15. 12. 19 11:13, Dominik Pantůček wrote: > Hi, > > On 15. 12. 19 2:57, Jack Firth wrote: >> I think that documentation fix is a good idea. > > I'll submit a PR to appropr

Re: [racket-users] ffi-lib and scribble/srcdoc

2019-12-23 Thread Dominik Pantůček
Hi, On 23. 12. 19 15:29, Sam Tobin-Hochstadt wrote: > What you're seeing is that `scribble/srcdoc` looks for the _binding_ > of `->` from `racket/contract` which is being shadowed by the version > of `->` from `ffi/unsafe`. I would do something like this: > > #lang racket > (require (rename-in

[racket-users] ffi-lib and scribble/srcdoc

2019-12-23 Thread Dominik Pantůček
Hello, apart from parallel sorting and working with unsafe ops, I stumbled upon a very strange behavior using ffi-lib: -->8-- #lang racket (require scribble/srcdoc) (provide (proc-doc/names a-struct? (-> any/c boolean?) (a) ("Returns true if a is a-struct"))) (struct

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

2020-04-12 Thread Dominik Pantůček
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

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

2020-04-12 Thread Dominik Pantůček
12, 2020, 4:23 AM, Dominik Pantůček < > dominik.pantu...@trustica.cz> 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 choi

Re: [racket-users] Retro 3D maze with Pict?

2020-04-19 Thread Dominik Pantůček
Hi, On 19. 04. 20 11:42, Aidan Gauland wrote: > Would it be feasible to use Pict to create a very simplistic rendering > of a first-person perspective of a 2D maze, in the style of Scarab of Ra > for the old > B Macs? > I've created

Re: [racket-users] Question about generating urls with dispatch-rules from imported modules

2020-04-26 Thread Dominik Pantůček
Hello, just a quick and dirty hack I use to get the best of default dispatch-... for my use-case when dispatching API requests: (define-for-syntax (dispatch-api-case-helper stx) (syntax-parse stx (((method:id (path+args:expr ...) proc:id) rest ...) #`((("api" path+args ...) #:method

Re: [racket-users] Rhombus project plan

2020-04-29 Thread Dominik Pantůček
Hi, I can't leave this without reaction... > >   To the point: what would make Racket2 the ultimate tool (for me): > > * Performance. Faster startup times, shorter execution times in > general. Optionally, a ‘lite’ version of Racket that compiles > directly to no-deps binaries,

[racket-users] Futures + threads SIGSEGV

2020-05-02 Thread Dominik Pantůček
Hello fellow Racketeers, during my research into how Racket can be used as generic software rendering platform, I've hit some limits of Racket's (native) thread handling. Once I started getting SIGSEGVs, I strongly suspected I am doing too much unsafe operations - and to be honest, that was true.

Re: [racket-users] Futures + threads SIGSEGV

2020-05-02 Thread Dominik Pantůček
lative computation in parallel. Usually if your code is too deep and keeps allocating "something" each frame, it goes back to the runtime thread for each allocation. Cheers, Dominik [1] https://docs.racket-lang.org/future-visualizer/index.html > > Dex > >> On May 2, 202

Re: [racket-users] Futures + threads SIGSEGV

2020-05-02 Thread Dominik Pantůček
anks again! Dominik > > [1] https://rr-project.org > > On Sat, May 2, 2020 at 7:56 AM Dominik Pantůček > wrote: >> >> Hello fellow Racketeers, >> >> during my research into how Racket can be used as generic software >> rendering platform, I've hit s

Re: [racket-users] Another futures-related bug hunt

2020-05-08 Thread Dominik Pantůček
Hello, On 08. 05. 20 14:27, Matthew Flatt wrote: At Fri, 8 May 2020 09:34:32 +0200, Dominik Pantůček wrote: Apart from obvious strace (after freeze) and gdb (before/after freeze) debugging to find possible sources of this bug, is there even a remote possibility of getting any clue how can

[racket-users] JIT and futures on aarch64

2020-05-16 Thread Dominik Pantůček
Hello fellow racketeers, after pushing futures on x86 and x86_64 to their limits (and helping fixing two bugs), I turned my focus on ARM. Apparently everything should work with 32bit arm without any hurdles (I am going to test that later today), however on aarch64 (64bit arm), there is no JIT and

Re: [racket-users] Another futures-related bug hunt

2020-05-09 Thread Dominik Pantůček
Hello, I'll add a lock at lines 1092-1096 of "newgc.c", and we'll see if that helps. should I open the issue or will you do it? (Speaking of race conditions...). I'll re-run the tests with the lock once it is in the repo - sometimes it takes hours for this bug to exhibit and with 8 HTs the

Re: [racket-users] Another futures-related bug hunt

2020-05-08 Thread Dominik Pantůček
Hello, The most useful information here is likely to be a stack trace from each OS-level thread at the point where the application is stuck. would this be enough to open an issue for that? (gdb) info threads Id Target IdFrame * 1Thread

[racket-users] Another futures-related bug hunt

2020-05-08 Thread Dominik Pantůček
Hello fellow Racketeers, my spare-time out-of-curiosity venture into using HPR (High-Performance Racket) for creating a software 3D rendering pipeline seems to be pushing the futures into rough edges. The scenario is sort of "usual": * 7 futures + 1 in RTT that form a binary tree * GUI

[racket-users] Cross-building Racket applications for 64bit Windows on Linux

2020-05-23 Thread Dominik Pantůček
Hello Racketeers, although I am developing Racket applications on Linux, our customers are usually running Windows. The good thing about Racket (and racket/gui especially) is that it requires virtually no OS-specific code for many - even non-trivial - tasks. However it is not that straightforward

[racket-users] Hunting a possible fsemaphore-post/wait bug

2020-05-23 Thread Dominik Pantůček
Hello again with futures! I started working on futures-based workers and got quickly stuck with a dead-lock I think does not originate in my code (although it is two semaphores, 8 futures, so I'll refrain from strong opinions here). I implemented a very simple futures-friendly queue using

Re: [racket-users] Cross-building Racket applications for 64bit Windows on Linux

2020-05-23 Thread Dominik Pantůček
cutables? >> >> https://docs.racket-lang.org/raco/cross-system.html >> >> >> Note that the "tarball" distributions at places like >> >>https://download.racket-lang.org/releases/7.7/ >> >> can be handy for setting up a . >>

Re: [racket-users] Hunting a possible fsemaphore-post/wait bug

2020-05-23 Thread Dominik Pantůček
On 23. 05. 20 19:24, Matthew Flatt wrote: > I'm not sure this is the problem that you're seeing, but I see a > problem with the example. It boils down to the fact that futures do not > provide concurrency. > > That may sound like a surprising claim, because the whole point of > futures is to

Re: [racket-users] Hunting a possible fsemaphore-post/wait bug

2020-05-24 Thread Dominik Pantůček
On 24. 05. 20 3:38, Matthew Flatt wrote: > At Sat, 23 May 2020 18:51:23 +0200, Dominik Pantůček wrote: >> But that is just where the issue is showing up. The real question is how >> the counter gets decremented twice (given that fsemaphores should be >> future

Re: [racket-users] racket user video meetup 28 November

2020-10-19 Thread Dominik Pantůček
Hi Stephen, that Gather thing was pretty cool for RacketCon. That is not an option here? Although I do not know about the costs of the setup... Of course, big thanks to everyone making RacketCon happen and everyone who attended. It was a refreshing experience to have a chat with all the rock

Re: [racket-users] new racket-lang.org website

2020-08-25 Thread Dominik Pantůček
site > thinks it is a normal machine (albeit uncomfortably narrow). If > things are slightly narrower you'll see the site changes. I am > attaching two screenshots from my phone.  > > Robby  > > > > > > On Tue, Aug 25, 2020 at 2:59 PM

Re: [racket-users] new racket-lang.org website

2020-08-25 Thread Dominik Pantůček
improve this, that'd be > welcome. > > It may be that the right approach is to adjust the font sizes, as > 1080x1920 sounds really wide. Is it possible that's a retina-style > display and the logical number is actually 540 wide? Maybe that's a > better cutoff for

[racket-users] New lightweight termios package: rktermios

2020-09-21 Thread Dominik Pantůček
Hello Racketeers, as I learned that it is not possible to use the ansi package under CS, because the C extensions do not work under CS, I decided to put together a minimalistic termios wrapper using only Racket code. It provides the bare minimum to set the terminal to "raw" mode and should work

Re: [racket-users] Package index

2020-09-21 Thread Dominik Pantůček
Hi, I confirm the issue. I am already a registered user but adding a new package fails with: Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /pkgn/package/rktermios. Reason: Error reading from remote server

[racket-users] Scribbling hexadecimal values

2020-09-18 Thread Dominik Pantůček
Hello Racketeers, I am struggling to make scribble typeset default values in proc-doc/names in hexadecimal. An example would be: (proc-doc/names name (->* () (integer?) void?) (() ((argument #x1f))) @{ some description }) ; yes, at-exp reader The same applies to values in nested

[racket-users] Possible bug in vector-cas!

2020-05-30 Thread Dominik Pantůček
Hello Racketeers, it didn't take long before I hit another strange behavior when extensively using futures. The setup is relatively simple: I am processing a large fxvector/flvector and I am processing it on a line-by-line basis (the vectors themselves are width*height in nature). To avoid races

Re: [racket-users] Re: trying to use futures for some calculations

2020-06-17 Thread Dominik Pantůček
I've looked at it only briefly (it's the end of the semester and grading is due soon). > > > I would *love* to be proven wrong on this, but I think it's rare to > be able to get decent parallelization in practice using futures. You > may have better results using places, but it will

Re: [racket-users] trying to use futures for some calculations

2020-06-17 Thread Dominik Pantůček
Hi Alex, I finally got to investigate the issue in depth. And there are two major problems blocking your implementation from running the futures in parallel. 1) Allocations of boxed flonums. I tried to get rid of those by allocating "scratchpad" flvectors and mapping everything onto them. The

[racket-users] Scribble markdown renderer: tables

2020-12-29 Thread Dominik Pantůček
Hello Racketeers, back from my procrastination projects to work :) In the biggest project our company is working on right now, we use Racket HTTP/REST backend and React.js frontend. The whole backend is fully contracted - even all the actual servlets that are exposed via HTTP are contracted. And

[racket-users] GUI button% string label keyboard mnemonics

2021-01-06 Thread Dominik Pantůček
Hello Racketeers, it's been a while since I was doing some serious GUI work but for one of my current work projects the time has come and surprise surprise - troubles on the way :) When a button is created like: (new button% (label "") ...) everything works as expected. The #\q key becomes a

[racket-users] Linear algebra performance (was: calculations with arrays)

2020-11-24 Thread Dominik Pantůček
Hello, > > If you are after numerical calculations for mxn matrices, then look at > `flomat` > which uses the same underlying C/Fortran library that NumPy uses. > > https://docs.racket-lang.org/manual-flomat/index.html > > If you need rrays with more dimensions than 2 use `math/array`. > > If

Re: [racket-users] Unsafe structs

2020-12-21 Thread Dominik Pantůček
On 21. 12. 20 18:14, George Neuner wrote: > > On 12/20/2020 3:34 PM, Dominik Pantůček wrote: >> Hello Racketeers, >> >> there were some discussions about structs' introspection on the IRC >> lately and one of the questions that arose was how to get field i

Re: [racket-users] Unsafe structs

2020-12-21 Thread Dominik Pantůček
On 21. 12. 20 18:07, David Storrs wrote: > > The struct-plus-plus module also provides reflection, so you might take > a look to see if there are any ideas in there that would be useful for > your own module. Accessors are included, as are constructors, rules, > wrappers, default values, and

Re: [racket-users] Unsafe structs

2020-12-21 Thread Dominik Pantůček
On 22. 12. 20 4:40, Philip McGrath wrote: > On Mon, Dec 21, 2020 at 7:30 PM Robby Findler > wrote: > > Is Typed Racket able to prove that your use of unsafe accessors is > actually safe? > I can try adding type annotations everywhere, but as I

[racket-users] Unsafe structs

2020-12-20 Thread Dominik Pantůček
Hello Racketeers, there were some discussions about structs' introspection on the IRC lately and one of the questions that arose was how to get field index for arbitrary struct's arbitrary field. Not that it is possible... But the general discussion made me think about why there are no unsafe

[racket-users] Namespaces and modules

2020-11-12 Thread Dominik Pantůček
Hello Racketeers, it seemed to me that writing a data format for my project by simply introducing a new syntax forms and then just eval'uating the file (maybe eval-syntax) was a great idea. I've done things like that many times but my initial bindings were always in a separate file. Like:

[racket-users] net-lib/ftp enhancement

2020-11-17 Thread Dominik Pantůček
Hello Racketeers, we were working on a module today that uses the net/ftp module for batch communication with some remote systems and realized we REALLY could use variants of ftp-download-file and ftp-upload-file that would accept ports instead of just folders/paths. So I looked at the source

Re: [racket-users] Racket BC versus CS unsafe flonums

2020-11-07 Thread Dominik Pantůček
Wow, you are faster than I :) On 07. 11. 20 15:36, Matthew Flatt wrote: > At Fri, 6 Nov 2020 12:45:46 -0700, Matthew Flatt wrote: >> I will investigate faster option. A primitive without conversion could >> make the safe `flvector-set!` slightly faster, too, by avoiding a >> redundant check. > >

Re: [racket-users] Namespaces and modules

2020-11-15 Thread Dominik Pantůček
> > Using ''sandbox as an argument to `namespace-require` to refer to a > local module is something like passing 'x to `eval` to try to refer to > a local variable `x`. The `namespace-require` procedure doesn't know > where it's being called from, so it doesn't work. > > Try

[racket-users] Racket CPU Graphics Engine - Time to Share

2020-10-30 Thread Dominik Pantůček
Hello fellow Racketeers, during the spring and summer I worked on a side project to test what can be done in pure Racket when it comes to raster graphics rendering. You can imagine it like demo or game programming before the advent of GPUs. It turned out that quite a lot can be achieved and it

Re: [racket-users] Re: Help implementing an early return macro

2020-10-28 Thread Dominik Pantůček
Hi racketeers, I would second this suggestion. Although it might look slightly un-rackety at first sight, for certain types of code flow it does the job really well. And most importantly - I am using escape continuations in much wilder setup (yes, futures) and it imposes no noticeable

[racket-users] Racket BC versus CS unsafe flonums

2020-11-06 Thread Dominik Pantůček
Hello Racketeers, going through some more possible optimizations of my side projects, I encountered a different behavior of unsafe-flvector-set! between BC and CS implementations: CUT HERE #lang racket (require racket/unsafe/ops racket/flonum) (define flv (make-flvector 10))

Re: [racket-users] Re: Scribble markdown renderer: tables

2020-12-30 Thread Dominik Pantůček
My impression is that the table generated by markdown render mixin is not a markdown table. This is what I get: ONE two 3 TWO three111 THREEone 222 From: (tabular (list (list "ONE" "two" "3") (list "TWO" "three" "111") (list "THREE" "one" "222"))) Also if you look at the

Re: [racket-users] GUI button% string label keyboard mnemonics

2021-01-09 Thread Dominik Pantůček
> Maybe a stupid question ... > > Is  "close-icon" the name of the bitmap or a function that creates a > bitmap? I am using images/icons/misc: https://docs.racket-lang.org/images/Icons.html?q=close-icon#%28def._%28%28lib._images%2Ficons%2Fmisc..rkt%29._close-icon%29%29 So it generates a

Re: [racket-users] Unsafe structs

2021-01-20 Thread Dominik Pantůček
Hi Sam, I went through all my notes and prepared minimal (sometimes) working examples for most of the issues I mentioned. Let's go through it one by one. I assume that some of the complications I encountered were because my lack of experience with Typed Racket. I hope some of these examples will

Re: [racket-users] Can someone please override the Reply-To so that normal replies go to the list?

2021-01-01 Thread Dominik Pantůček
> > Proper mail systems also provide a command "reply to list". The proper > fix is to make sure your mail system supports reply to list. > Which seems to work only if the list is in the "To:" header - not "Cc:". At least that is how my Thunderbird apparently works... Dominik -- You

Re: [racket-users] Unsafe structs

2021-01-02 Thread Dominik Pantůček
Hello Racketeers (and Robby especially)! On 22. 12. 20 1:30, Robby Findler wrote: > Is Typed Racket able to prove that your use of unsafe accessors is > actually safe? Short answer: YES. One question for a start: And what now? Disclaimer: The following text is by no means intended as critique

Re: [racket-users] Registered on irc.libera.chat

2021-05-24 Thread Dominik Pantůček
Hello, I am always advocating for being cautious - rather than rushing into quick decisions (which may prove wrong later on). However, given known facts, the situation with Freenode won't probably change for any better in the foreseeable future. I'd like to hear more opinions though before I (or

Re: [racket-users] signup to racket users without a google account?

2021-02-08 Thread Dominik Pantůček
It works - this is how I subscribed to this list (as I am not using Google services). Dominik On 08. 02. 21 20:18, Paulo Matos wrote: > > Stephen De Gabrielle writes: > >> Hi, >> >> Someone over on reddit /r/racket wants to joining the mailing list without >> creating a goodle account - I

[racket-users] Next Racket Meetup: Saturday, May 1st

2021-04-04 Thread Dominik Pantůček
Hello fellow Racketeers, although the meetup yesterday wasn't actually crowded, an interesting discussion about fortifying macros, lambda calculus, lazy racket, or inter-language interoperability started. We'd definitely like to see more Racketeers with interesting papers, projects or generally

Re: [racket-users] Word Count program/benchmark performance

2021-03-19 Thread Dominik Pantůček
Another attack of [1]. But yeah, why not do some [2]. Trees to the rescue [3]. $ racket --version Welcome to Racket v8.0 [cs]. $ racket countwords-bogdan2.rkt https://xkcd.com/386/ [2] http://phdcomics.com/comics/archive.php?comicid=1735 [3]

Re: [racket-users] Racket Meetup! 6 March

2021-03-04 Thread Dominik Pantůček
Hello Racketeers, just a friendly reminder here on the ML - this Saturday brings the next monthly Racket meetup(s) in Gather Town! >From the latest Racket News[1]: 6 March 2021 TWO sessions 11 am Pacific Time 4:30 pm UK time See you there! Dominik [1]

[racket-users] Bit Scan Reverse in Racket

2021-02-25 Thread Dominik Pantůček
Hello Racketeers, I'm slightly stuck with speeding up some calculations and the reason is that I need to compute the index of highest set bit in a number. So for 1 it is 0, for 2 it is 1, for 8 3, 1023 9 and 1024 10 ... The fastest Racket code I can come up with is as follows:

Re: [racket-users] Bit Scan Reverse in Racket

2021-02-25 Thread Dominik Pantůček
On 25. 02. 21 10:01, Jens Axel Søgaard wrote: > Try integer-length. > > https://docs.racket-lang.org/reference/generic-numbers.html?q=integer-length#%28def._%28%28quote._~23~25kernel%29._integer-length%29%29 Oh, I completely missed this one. Thank you!!! > > I don't know how it is

Re: [racket-users] Werid contract violation blame erros

2021-04-07 Thread Dominik Pantůček
It is worth noting that it is relatively easy to implement a define/provide/contract syntax without any problems. In my two most active projects I use it extensively. In one case even with scribble/srcdoc to keep the contracts, scribblings and implementation in one place. The simplest version:

Re: [racket-users] Variadic fixnum operations (was: Unsafe structs)

2021-04-15 Thread Dominik Pantůček
Hello Racketeers, >> * Math/Fixnums/Flonums: All fx+/-/*/... accept two arguments only. No >> unary fl-, no variadic-argument fl+ or fxior (this one hurt the most). > > These definitely became variadic after the type definitions were > written, but that's of course not an excuse for not updating

[racket-users] Typed Racket: type relations

2021-04-15 Thread Dominik Pantůček
Hello Racketeers, working on gradually typing some of my modules I encountered an interesting problem: (define-type Color Fixnum) (: argb-average (-> Color * Color)) (define (argb-average . argbs) (let loop ((as : Fixnum 0) (rs : Fixnum 0) (gs : Fixnum 0)

[racket-users] Strange problem with racket/gui

2021-04-10 Thread Dominik Pantůček
Hello Racketeers, with GUI widgets tree like: vertical-panel% vertical-pane% vertical-pane% horizontal-pane% text-field% horizontal-pane% horizontal-pane% message% vertical-pane% slider% After pressing when the text-field% has focus, the text-field%

Re: [racket-users] Polished 3D package for some simulations

2021-04-12 Thread Dominik Pantůček
One clicks on your Twitch and the first thing coming from the speakers is "Do you remember Jack? Jack Firth?" Everyone does, of course ;-) On 12. 04. 21 17:31, Stephen Foster wrote: > In the CodeSpells project, we are using Racket + Unreal Engine.  This > combo would be my recommendation for

Re: [racket-users] Typed Racket: type relations

2021-04-19 Thread Dominik Pantůček
>>> >>> However, I would suggest that the right fix here is to use refinement >>> types, and specify exactly what you want. Unfortunately, the >>> refinement types feature (good intro here: >>> https://blog.racket-lang.org/2017/11/adding-refinement-types.html) >>> isn't quite able to prove

Re: [racket-users] Typed Racket: type relations

2021-04-20 Thread Dominik Pantůček
>> Of course Ben's hint at unsafe-reprovide is something I'd like to >> investigate. > > My hint turned into a PR and merged a few years ago. > https://github.com/racket/typed-racket/pull/657 > I read that one yesterday - it does not address the issue fully. I meant the hint at really

Re: [racket-users] Typed Racket: type relations

2021-04-18 Thread Dominik Pantůček
0. Thank you very much for looking into this. On 18. 04. 21 4:57, Sam Tobin-Hochstadt wrote: > Ok, three parts: > > 1. Is it possible to make `average` on `Byte` provably produce a > `Byte`? This is not going to be possible with plain Typed Racket, even > with refinements to the numeric tower.

Re: [racket-users] Typed Racket: type relations

2021-04-16 Thread Dominik Pantůček
I wanted to polish things a bit before starting a longer discussion, but here we go ;-) The code in question[1] is part of my work into exchanging unsafe modules which can be used either contracted or uncontracted for TR modules. The goal is to replace racket/unsafe/ops with TR to provide

Re: [racket-users] file/gzip trouble reading

2021-02-16 Thread Dominik Pantůček
On 16. 02. 21 22:27, Matthew Flatt wrote: > At Tue, 16 Feb 2021 16:03:29 -0500, Ben Greenman wrote: >> Sadly, I've already compressed a few files using >> `call-with-output-string` ... is there an easy way to decompress those >> / undo the UTF-8 encoding? > > Unfortunately, the underlying

Re: [racket-users] Ubuntu PPA also updated to v8.0

2021-02-22 Thread Dominik Pantůček
On 22. 02. 21 19:56, Asumu Takikawa wrote: > On 2021-02-18 21:44:30 -0800, Asumu Takikawa wrote: >> Due to changes in how the new CS compiler works, some files have been >> moved between the three .deb packages that are in the distribution. > > It looks like this change broke package upgrades.

Re: [racket-users] Racket meeting tomorrow?

2021-10-01 Thread Dominik Pantůček
I truly hope that the standard time (10pm CEST, 8pm UTC) and place (gather.town) tomorrow. Although I missed a few as I was busy with other projects over the summer, I'd like to see what others are up to again ;-) See ya there! Dominik On 01. 10. 21 18:49, Hendrik Boom wrote: Is there going

Re: the end of the [racket-users] mailing list and the migration to Discourse as a forum for Racket

2021-11-23 Thread Dominik Pantůček
Hello Racketeers, I wouldn't take it as passive-aggressive per-se. It's just super confusing. Especially if you watch the discussion about future of Racket at RacketCon where Matthias has stated it pretty clearly and other confirmed that - the core team is doing all infrastructure maintenance

[racket-users] srfi/19 implementation in Racket's srfi-lib

2021-11-13 Thread Dominik Pantůček
Hello Racketeers, the ~S formatter [1] in srfi/19's date->string expects struct with nanoseconds, which means it is impossible to use it with plain date structs (only date*). Is this required by how SRFI 19 should work or can I submit a patch to make it optional? Format strings work up to

Re: [racket-users] future question

2021-11-12 Thread Dominik Pantůček
Hi, you are looking for make-fsempahore[1] and related: === #lang racket (define sema (make-fsemaphore 1)) (define (make-th i) (λ () (let loop ((a 0)) (when (zero? (modulo a #e1e6)) (fsemaphore-wait sema) "do what you have to do without disturbing other futures"