
How does this “half-bakedness” manifests itself?

I don’t think this solves my problem. My issue is that I do not want to implement that generic interface on my struct. Not becase the interface is not known when defining the struct (yet the reverse is) but simply I’d like to keep the struct definition clean from orthogonal features. Imagine a generic interface for Jsonifying/Database/Automatic Routing/etc. One could end up with a huge monster struct.

@dev.guoj has joined the channel

@leif @mflatt Is the nanopass Racket compiler rewrite still a thing now that the Chez rewrite is planned? Or does the latter subsume the former?

@lexi.lambda I haven’t touched it in a while, although Chez’s compiler is nanopass.

Although I don’t know how hard it is to compile Racket code to chez code. @mflatt would obviously know about that more than me. :wink:

BTW, can anyone give me a good idea of when to use struct properties vs generics?:

woops, wrong question.


I ask because the convertible library (and pict-convertible library), are still using properties. So if I make another convertible library (video-convertible), should I use properties rather than generics.

@preethac has joined the channel

@leif Thanks, that makes sense. I was just sort of idly wondering about how hard it would be to add GHC-style rewrite rules to Racket, and I figure it would be a lot easier to add to a compiler written in Racket rather than one written in C.

@leif probably struct properties should only be used when the value stored in the property isn’t a function (or something function-like like a struct field index)

@leif I think if you’re compatible with convertible
(which sounds nice) then use properties

if you’re building something new, use generics

I think the only thing generics can’t do that props can is associate a value with a struct type itself in a way where you don’t need an instance of the struct to access it; the generated methods of a generic interface always need an actual instance of the struct passed to them. Like how typeclasses let you associate a value with a type (such as mempty
in Monoid
) but OO interfaces can’t do that.

How can I test that two syntax objects have the same scopes? Is using (equal? (datum->syntax stx1 #f) (datum->syntax stx2 #f))
a reasonable way?

I think you could try that, but compare using free-identifier=?
on a symbol instead of #f

ah, so (let ([id (gensym)]) (free-identifier=? (datum->syntax stx1 id) (datum->syntax stx2 id)))
would be better?

that’s my best suggestion

thanks!

@notjack bound-identifier=?
tests whether or not two things have the same scopes, not free-identifier=?

free-identifier=?
tests if two identifiers have the same binding

oh right

yeah bound-identifier=?
is definitely what I want

(I’m sure @samth knows this, just a minor detail)

@samth whelp. I have no clue why that last pict run timed out. IDK what else to do other than disable the "auto pict conversion"
test-suite
its associated tests entirely. (The computer on which I could reproduce this is currently borked atm too…)
BTW do you know if we can clear the timer logs for that file or something? Its currently making the drdr page really slow to load it seems.

Writing a paper in Scribble/acmart/@acmsmall, using bibtex. Was able to get citations as [1…99] numbers, aka #:style number-style, but they are not linked to the bibtex entry. Is there a way, and probably an easier way, to make this happen. Was using a similar bib.rkt file from one of Van Horn’s papers:
#lang racket
(require scriblib/autobib scriblib/bibtex)
(provide ~cite citet generate-bib)
(provide (all-from-out scriblib/bibtex scriblib/autobib))
(define-bibtex-cite "occam.bib" ~cite citet generate-bib #:style number-style)
`

@zeeshanlakhani try using the small-number-style
code here: https://github.com/bennn/gtp-paper/blob/master/template/main.rkt#L94

(I inherited that code from Asumu … and I think it’ll add the links like you want.)

@ben thanks, i’ll try it out

@ben it does indeed link things, but always takes me to the first page upon click

we are using a bib file though

that’s weird and bad …

let me take a look at the generated tex

here’s a full example, also using a bib file: https://github.com/nuprl/gradual-typing-performance/tree/master/paper/popl-2016

are you calling generate-bibliography
somewhere?

@ben yep, calling it the main scribble file

at the bottom, after all the include-section
s? (not sure if that matters)

yep, it’s the last thing

oops haha

~[\Thyperref{48}{autobiblab:48}]
is what a citation looks like in tex

add this to your texstyle \newcommand{\Thyperref}[2]{\hyperref[#2]{#1}}

ah, ok

(or change render-citation
to generate a call to \hyperref
)

ok

is it working?

not yet. going to look at generating hyperrefs

ok (did “texstyle” make any sense?)

yeah, i have a .tex file for other things we’re using and have \newcommand{\Thyperref}[2]{\hyperref[#2]{#1}}

in there

run it as per raco scribble ++style style.tex...

was actually looking at https://github.com/migeed-z/retic_performance/blob/fdf795946b311e7d64f04902ab54e322f03594df/dls/common.rkt to see if I missed something. Odd that it works elsewhere

for these

I do realize that in popl–2016 example, define-site does not point to the .bib filename though

the cs.bib

as we’re doing, where we point to the bib file specifically

oh, good point. Try using just define-cite
?

… I guess you’d have to reformat your bib file

yeah @ben. thinking that may do the trick as i build examples. Will try that tomorrow possibly.

but, maybe I’ll play around w/ the code and see. it seems like it should still match up, but we’ll see.

ok, feel free to send me your bib file if you get stuck. I can try later tonight.

oh, great. Yeah. I’ll dm that to you

as an update to our convo, seems like the snippet works find when using @sigplan, but not for @acmsmall or @acmtog, etc…