jordi
2017-8-23 07:06:00

@jordi has joined the channel


jordi
2017-8-23 11:55:45

Hi! I’m new to Racket and wanted to use it in a Calculus course starting september. Totally unrelated but I’m currently at a summer course (http://school.grammaticalframework.org/2017) and wanted to make Racket bindings to the thing used here (http://www.grammaticalframework.org) using ffi. Now the question: what is the right way to connect to a cstruct like this: typedef struct PgfApplication PgfApplication; struct PgfApplication { PgfCId fun; int n_args; PgfExpr args[]; }; where fun is basically a string. The problem is args which is expected to be dynamically created and to have n_args elements. Thanks in advance!


Bot messages not yet supported
Bot messages not yet supported
Bot messages not yet supported
Bot messages not yet supported
Bot messages not yet supported
samth
2017-8-23 17:48:46

hashim: it’s fine to ask here


Bot messages not yet supported
leif
2017-8-23 20:02:27

Would anyone know why putting picts in code causes the code to become unaligned?


leif
2017-8-23 20:02:27

leif
2017-8-23 20:02:56

(If you remove the (code "hello") line, it gets aligned as you would expect


leif
2017-8-23 20:03:23

leif
2017-8-23 20:04:29

(it also remains if I replace that line with a different pict, or freeze the pict altogether.


notjack
2017-8-23 21:01:52

samth
2017-8-23 21:07:32

it’s the library path that the identifier is defined in


notjack
2017-8-23 21:10:53

is there any way to control the url structure for a particular definition?


notjack
2017-8-23 21:12:11

wondering if there’s a way I can define a link relation as a racket value with a URL pointing to its documentation without the relation being really, really ugly looking / percent encoded / contain redundant information


ben
2017-8-23 21:23:32

@jordi I don’t know the FFI, but this tutorial might help: http://prl.ccs.neu.edu/blog/2016/06/27/tutorial-using-racket-s-ffi/


ben
2017-8-23 21:24:43

use hyperlink ?


notjack
2017-8-23 21:29:11

@ben not put a link in scribble, but use scribble docs as a link relations registry like https://www.iana.org/assignments/link-relations/link-relations.xhtml


notjack
2017-8-23 21:31:25

or just somehow get a registry out of a package catalog so I don’t need to register a domain to get a unique url for a link relation


leif
2017-8-23 21:33:58

@notjack It actually does that if there are conflicts


leif
2017-8-23 21:34:34

If you look at the video manual (http://lang.video/documentation.html) which uses the package server, each package gets its own url


leif
2017-8-23 21:34:39

If that’s what you’re talking about


notjack
2017-8-23 21:35:27

@leif actually, thinking about it more, I specifically do not want the package name to be part of the url so I have the freedom to move the code between packages without breaking links


notjack
2017-8-23 21:35:59

this would definitely not be possible with scribble, though maybe some weird extension built on top of the catalog that did things with info files could do it


ben
2017-8-23 21:39:24

something like <http://docs.racket-lang.org/?pkg=foo&amp;tag=bar> ?


ben
2017-8-23 21:39:56

which would search for a package currently named foo and an identifier (or something) currently named bar (current = since most recent build of the docs)


notjack
2017-8-23 21:41:05

no, more something like <http://registry.pkgs.racket-lang.org/relations/bar> which would redirect to the scribble docs for bar in foo


notjack
2017-8-23 21:41:43

basically I want a way to use the package system to somehow let packages define unique identifiers across all packages in a catalog, in a way that lets the definition of the identifier move between packages without breaking things


samth
2017-8-23 21:42:07

@notjack how would you deal with identifiers that need % encoding?


samth
2017-8-23 21:42:35

or, more significantly, packages that provide multiple bindings with the same name


samth
2017-8-23 21:42:57

for example, typed-racket-lib provides a lot of different #%module-begin bindings


notjack
2017-8-23 21:43:36

specifically I’d want this registry server to look for conflicts and do something ring-like in choosing which one is the “official” one, with two packages providing the same relation ID being something you could consider a test failure


notjack
2017-8-23 21:44:23

this is for ids that are “very special” in that they’re not just code ids, they’re ids for resources in some resful distributed system (like link relations)


ben
2017-8-23 21:44:55

ok what if <http://docs.racket-lang.org/search/index.html?q=bar\|docs.racket-lang.org/search/index.html?q=bar> just used rings to rank results?


ben
2017-8-23 21:45:26

alright I see “very special”


notjack
2017-8-23 21:46:43

emphasis on very


leif
2017-8-23 21:52:28

:pizza: ?


leif
2017-8-23 21:52:29

lol


leif
2017-8-23 21:52:32

I’m hungry now


notjack
2017-8-23 21:54:01

:pizza: :pizza: :pizza:


mflatt
2017-8-23 22:52:41

@notjack @ben that’s close to what happens when you use an “indirect” link that goes through the “local-redirect” layer (but the use of rings is new as of today, when the pkg-build system started paying attention to rings);the indirect-link index is currently limited in what it covers, but you might look there for implementation ideas; anyway, unless I’m confused about what you’re suggesting, this is not only possible with Scribble, but it’s substantially already in place


notjack
2017-8-23 23:01:26

@mflatt I didn’t really explain what I wanted very well or in detail. The indirect links are sort of related though, thanks for the pointer


jaguilar
2017-8-24 00:18:52

@jaguilar has joined the channel


jaguilar
2017-8-24 00:20:26

People are pretty quiet right now over on IRC, so I figured I’d ask here as well.


jaguilar
2017-8-24 00:20:30

I was looking at https://github.com/racket/racket/blob/master/racket/src/racket/src/hash.c I was wondering … has anyone tried linear probing rather than double hashing in this hash table? And how sensitive is racket perf to the perf of this table?


jaguilar
2017-8-24 00:20:54

I guess the last question would be, what’s the bar for changing behavior at this level?


jaguilar
2017-8-24 00:21:13

(I’m refering to the traditional hash table, not the mzhamt thing


samth
2017-8-24 00:56:31

@jaguilar I expect that @mflatt has tried other hash tables, I think improving them would help many Racket programs, and the bar is convincing improvement, I would say


jaguilar
2017-8-24 00:58:20

So we aren’t worried about people having dependencies on the exact shape of the internal hash function, for example? My thoughts were: 1. plug the hash function into SMHasher to see what we’re working with. Linear probing is known to be very sensitive to hash function quality.


jaguilar
2017-8-24 00:58:53

If there’s any problem, try replacing the hash function with something of good quality.


jaguilar
2017-8-24 00:59:07

After that, update the code, run some benchmarks, and see whether there is a detectable change.


mflatt
2017-8-24 01:01:59

I don’t think there would be any problem moving away from double hashing. The Racket-on-Chez port uses single hashing with linked lists for collisions, since that’s what Chez Scheme provides.


jaguilar
2017-8-24 01:02:33

OK. I’ll take a look. Any particular benchmarks y’all like to run to verify changes to internals?


mflatt
2017-8-24 01:18:13

Aside from microbenchmarks, trying a build (maybe plotting like http://build-plot.racket-lang.org/) is often a good exercise to make sure that things don’t go surprisingly wrong, since a build relies on so many different things.


samth
2017-8-24 01:57:51


jaguilar
2017-8-24 03:26:44

I have been working on testing the string hashing function using SMHasher


jaguilar
2017-8-24 03:27:09

I am just testing the initial value, to see what our collision properties are


jaguilar
2017-8-24 03:27:19

It looks not so good


jaguilar
2017-8-24 03:27:35

And at least on my VM, it’s about 1/10th as fast as CityHash64 on longer strings


jaguilar
2017-8-24 03:28:14

I wonder if there’s an appetite for taking on a purpose built hashing library like xxhash as a dependency


jaguilar
2017-8-24 03:30:32

But it’s possible I’m doing something wrong. I’ll have to look at it more later.


jordi
2017-8-24 06:05:07

Will try it, thanks :+1: