soegaard2
2021-5-22 08:47:59

Hi All,

I have just found two messages on the Cairo mailing list. In order to simplify maintenance they plan to drop some of the backends. And switch from Autotools to Meson (Python based build tool).

Since Racket relies on Cairo I thought it were a good idea to draw attention to the change. However, I don’t think the dropped backends affect us(?). Although I am unsure whether Racket uses the Cairo GL backend for anything.

Note that the Emmanuele writes this about the Quartz backend: [1]: Provisionally; the performance of the Quartz backend on modern macOS has degraded to such a point that it's literally faster to draw on image surfaces. ~That is, I think, he would prefer to drop support for the Quartz backend in the long run.~ ~(If a CoreGraphics backend existed it would make sense to drop Quartz - but there are no CG backend).~ I still think, he means the Quartz backend is slow (slower than a direct GL backend), but Quartz is part of CoreGraphics not an alternative.

For 1.17.8, the plan is: - clean up the repository - remove old documentation files - move documentation to Markdown - consolidate boilerplate/build gunk - Meson parity with Autotools on Linux, Windows, and macOS - drop the Autotools build - drop the known broken/unmaintained/abandoned upstream backends: - drm - qt - beos - OS/2 - cogl - directfb - OpenVG - put the GL backend "on notice" - if somebody shows up and is willing to review and fix the issues, we can keep it; otherwise, it goes The initial proposal of changing release management: https://lists.cairographics.org/archives/cairo/2021-April/029218.html The plans for 1.17.8. https://lists.cairographics.org/archives/cairo/2021-May/029251.html


alexharsanyi
2021-5-22 09:10:01

I also read this discussion on the Cairo list a few days ago. While I know nothing about Cairo’s internal architecture my two areas of concern were:

• The main problem with the GL back-end (apart from being unmaintained) is that the Cairo architecture is not suited to GPU based rendering. This makes the GL backend difficult to write and less performant than it could be. • If I understand correctly Emmanuele (the person who wrote the initial email) volunteered to take over the build management because the GTK libraries still rely on Cairo and they are several years away from removing the Cairo dependency (they are however actively working on that). He just wants the Cairo build to work well with the GTK build system. I would be very happy if someone would tell me that I am 100% wrong on both of the above points.


soegaard2
2021-5-22 09:11:14

I got the same impression as you.


soegaard2
2021-5-22 09:59:38

While reading some older mails on the mailing list, I notice that there is work on a Cogl backend, which is a low-level api with a GL backend (if I understand correctly). https://developer.gnome.org/cogl/1.22/


plevexier
2021-5-22 13:07:38

morning all, for the emacs user, is there a way to show and navigate to the errors in code (with racket-mode)?


soegaard2
2021-5-22 13:11:04

racket-xp-next-error C-c # N Go to the next error. racket-xp-previous-error C-c # P Go to the previous error.


soegaard2
2021-5-22 13:11:32

The easiest is usually to click the filename (the first line of the error).


plevexier
2021-5-22 13:12:22

yes, it doesn’t work, the first line of the error is always: “build-path: absolute path cannot be added to a base path”


plevexier
2021-5-22 13:12:29

(it’s on windows btw)


plevexier
2021-5-22 13:12:40

so i know i’m playin with fire lol


plevexier
2021-5-22 13:13:09

and then the C-c # N and P don’t do anything


soegaard2
2021-5-22 13:13:22

Do you have a screenshot?


plevexier
2021-5-22 13:13:27

sure


plevexier
2021-5-22 13:14:45

plevexier
2021-5-22 13:15:10

whatever the error it always shows that


sorawee
2021-5-22 13:15:11

So, this is a runtime error, right?


plevexier
2021-5-22 13:15:16

yes it looks like


plevexier
2021-5-22 13:15:23

yes it is


plevexier
2021-5-22 13:15:33

when I C-c the program


soegaard2
2021-5-22 13:15:52

I am confused - is this an error in racket-mode? (not in your code?)


plevexier
2021-5-22 13:16:13

it’s in the repl while C-c C-c my code


plevexier
2021-5-22 13:16:23

to run it


soegaard2
2021-5-22 13:16:40

Is the call to build-path in your code?


plevexier
2021-5-22 13:16:50

no


soegaard2
2021-5-22 13:17:01

Then I think it is a bug in racket-mode.


plevexier
2021-5-22 13:17:16

makes sense


plevexier
2021-5-22 13:17:36

I’m gonna see if I can find some info about that thanks


soegaard2
2021-5-22 13:17:56

Maybe @greg knows more?


plevexier
2021-5-22 13:19:03

I have to develop on windows since it’s the target OS and want to make sure it’s gonna work for it


soegaard2
2021-5-22 13:19:45

You can find out by running that file in DrRacket - if you get the same error, then the problem is yours :slightly_smiling_face:


plevexier
2021-5-22 13:20:10

yes it works fine in DrRacket


plevexier
2021-5-22 13:20:56

emacs on windows is already shady, and + racket-mode… lol


soegaard2
2021-5-22 13:26:14

As someone not that well-versed in Windows, is your Emacs a normal Windows application, or is it running in WSL or similar?


plevexier
2021-5-22 13:26:58

normal windows app


plevexier
2021-5-22 13:27:42

could be a long path issue, gonna move the directory directly under c, let’s see


soegaard2
2021-5-22 13:29:02

Around line 207 in error.rkt:


plevexier
2021-5-22 13:30:30

ah yes


plevexier
2021-5-22 13:31:23

gonna play with that, see if I can fix


plevexier
2021-5-22 13:31:31

thanks a bunch, i’ll update



plevexier
2021-5-22 13:33:17

moving to a shorter path doesn’t fix it


soegaard2
2021-5-22 13:34:26

I think the first path ought to have been “manage_dialog.rkt” only. A filename can be added to the base path just fine.


plevexier
2021-5-22 13:35:17

yes in there:


plevexier
2021-5-22 13:35:18

; absolute path: "\Users\Patrice\dev\racket\seassist2\manage_dialog.rkt" ; base path: #<path:c:\Users\Patrice\dev\racket\seassist2&gt;


plevexier
2021-5-22 13:36:25

there’s something fishy in the way those paths are shown


soegaard2
2021-5-22 13:36:26

Maybe it due to the note in blue?


soegaard2
2021-5-22 13:38:06

I think, the (not (complete-path ...)) is used to determine whether the path is relative. And if it were relative, then the build-path would have worked.


plevexier
2021-5-22 13:39:12

yes, makes sense


plevexier
2021-5-22 13:39:39

i’m in that code, let’s see if I can fix


greg
2021-5-22 14:08:32

It might be that complete-path? should be replaced with absolute-path? there. Or it might be it should test that both aren’t true — unless the path is neither absolute nor complete, just use it as-is.


greg
2021-5-22 14:09:42

The “other end” might be relevant, too. Why is the original thing "\\Users\\Patrice\\dev\\racket\\seassist2\\manage_dialog.rkt" without a drive letter. If it had a drive letter — if it were both absolute and complete — then IIUC it would work fine, too.


greg
2021-5-22 14:10:39

I have to run soon and can’t look at this in detail now, but if you’re able to figure out some things, that would be great, thanks, and I’ll catch up later.


plevexier
2021-5-22 14:12:18

thank you greg, i’m out right now but i’ll work on it later and will update


plevexier
2021-5-22 14:42:18

yes, I confirm, just returning ‘s’ like so:


plevexier
2021-5-22 14:42:18

(define (complete-paths s) (displayln (string-append "s=" s)) #\| (regexp-replace* #px"([^:]+):(\\d+[:.]\\d+)" s (λ (_ orig-path line+col) (~a (or (and (not (complete-path? orig-path)) (existing (build-path (current-directory) orig-path))) orig-path) ":" line+col))) \|# s)


plevexier
2021-5-22 14:42:38

fixes the issue


plevexier
2021-5-22 14:43:36

so gonna dig more on how to fix the rest of the function, pretty green with racket so no guarantee :slightly_smiling_face:



plevexier
2021-5-22 16:37:57

I’m gonna work on it later today, it’s a good exercise actually, and will update here and on github, awesome work with racket-mode btw, didn’t realize you were the author


plevexier
2021-5-22 16:46:19

did a quick test, just changing complete-path? to absolute-path? fixes it


plevexier
2021-5-22 16:46:40

not sure about regression (for other OSes) but this issue is gone


soegaard2
2021-5-22 18:02:11

I have a C library that allocates a data array. At the Racket side, I’d like to make it a u32vector. The docs has a u32vector-&gt;cpointer, but does not have the opposite.

The implementation of u32vector simply wraps the pointer with a length in a struct named u32vector. But make-u32vector is not exported (as far as I can tell).

Is there a way to trick the system, so I can make a cpointer-&gt;u32vector ?

https://github.com/racket/racket/blob/master/racket/collects/ffi/vector.rkt


soegaard2
2021-5-22 18:02:35

Or (hopefully) I am missing something simple?


soegaard2
2021-5-22 18:08:12

Worst case, I suppose, I could make an empty u32vector and then use ptr-set! to chance the two fields. Feels a bit too hacky.


soegaard2
2021-5-22 18:17:58

In the meantime, I will use make-cvector* .


massung
2021-5-22 19:03:54

Anyone know of a good alternative to Levenshtein where a greater emphasis is put on characters at the start and matching characters? For example, let’s say I have the following two strings: “go” and “dlang”. Now I compare “golang”. Levenshtein will match closer to “dlang” than to “go”.


soegaard2
2021-5-22 19:05:07

Can you “cheat” and give “ggoo” “ddlangg” and “ggolangg” to the Levenhstein algorithm?


massung
2021-5-22 19:06:32

lol. that’s interesting


massung
2021-5-22 19:08:51

this is input from a user, so doing things like that likely aren’t reasonable


o.strickson
2021-5-22 20:14:19

@o.strickson has joined the channel


jestarray
2021-5-22 21:05:14

jestarray
2021-5-22 21:05:24

how come minimal racket is not linked for the 8.0 releases?



samth
2021-5-22 21:19:46

@jestarray the download page was reorganized for 8.0


jaz
2021-5-22 21:38:43

Jaro-Winkler gives weight to a matching prefix. I imagine you could modify it to do the same for a matching suffix.


mflatt
2021-5-22 21:47:08

Probably we should change that page to link to the “all variants” page for 8.0 and up.


massung
2021-5-22 21:57:21

thanks for the info


jaz
2021-5-22 22:12:32

Oh, I didn’t read that very closely and thought you meant “start and end.” By “matching characters” do you mean exact matches in the same positions?


massung
2021-5-22 22:15:43

Yeah, but that’s overall less important than matching the start


jaz
2021-5-22 22:23:17

I actually have implementations of a few string similarity metrics. Standard J-W will still consider “golang” and “dlang” more similar than “go” and “golang,” but you could adjust the weight of the prefix match.


claiborn
2021-5-23 00:37:36

@claiborn has joined the channel