dmitryhertz
2018-3-28 12:50:01

¡Hola amigos! There are contracts and static typing. What’s better to use usually? Some racketeers claim that in case when we haven’t complex logic it’s better to use static typing, in case of developing of a prototype module or if we need something more than just type checking then racket/contract is our solution. I’m trying to figure out.


pnwamk
2018-3-28 15:39:48
Anyone dealt with #lang scribble/acmart and `\bigtimes' already defined recently? I’m getting this error even when just rendering an “empty” scribble/acmart file to PDF =

pnwamk
2018-3-28 15:40:05

i.e. this generates that error:


pnwamk
2018-3-28 15:40:11
#lang scribble/acmart

@title{Surreal Numbers}
@author{Ursula N. Owens}

pnwamk
2018-3-28 16:13:24

I ended up creating a custom-acmart.cls with \let\bigtimes\undefined at the end. My Makefile then overwrites the scribble-generated acmart.cls with my custom version and this avoids the issue


pnwamk
2018-3-28 16:13:38

if someone has a better fix off the top of there head let me know :wink:


leif
2018-3-28 16:49:30

@pnwamk Weird. What command are you using to run scribble?


leif
2018-3-28 17:02:28

Has anyone on here noticed that the rsvg package on os x causes Racket to segfault?


leif
2018-3-28 17:03:04

In the function cairo_scaled_glyph_page_destroy, which seems to be called from: rsvg_handle_render_cairo.


pnwamk
2018-3-28 17:08:59

@leif I see it both when I click “Scribble PDF” in DrRacket and when I try to run xelatex on the result of running scribble --latex ++style style.tex paper.scrbl


leif
2018-3-28 17:09:32

Interesting. Can you send us your style.tex file?


pnwamk
2018-3-28 17:10:21

it’s just this one line:


pnwamk
2018-3-28 17:10:25
\newcommand{\identity}[1]{#1}

pnwamk
2018-3-28 17:11:07

Also I don’t think it’s used when you click “Scribble PDF” in DrRacket… so I don’t think it’s a factor (I could be wrong though I suppose)


leif
2018-3-28 17:21:56

No, I think you’re correct. Just wanted to double check.


leif
2018-3-28 17:22:02

That is very odd. :confused:


leif
2018-3-28 17:22:23

So, can I ask what version of Racket you are on?


pnwamk
2018-3-28 17:22:50

6.12


leif
2018-3-28 17:29:11

Hmm…very odd. I don’t get that error in 6.12:


leif
2018-3-28 17:29:17

~/racket-archive/Racket\ v6.12/bin/scribble --pdf foo.scrbl


leif
2018-3-28 17:30:14

Do you mind sending me the style file your copy of scribble is using?


pnwamk
2018-3-28 17:34:35

@leif


leif
2018-3-28 17:37:30

@pnwamk Hmm…your acmart.cls file looks right. How about the style.tex file that is in scribble-lib/scribble/acmart/style.tex?


notjack
2018-3-28 18:15:26

It depends on the problem, on your problem solving style, on how the solution will be maintained in the future, and on who you’re working with. My suggestion is to try both untill you feel relatively comfortable with both approaches before listening to the advice of others about which is better.


leif
2018-3-28 18:38:36

A recent change in Racket causes the python package to no longer build.


leif
2018-3-28 18:38:47

The file with the error is: https://github.com/pedropramos/PyonR/blob/master/libpython.rkt

And the particular error is:


leif
2018-3-28 18:39:00
raco setup:   void-if-not-available: undefined;
raco setup:    cannot reference an identifier before its definition
raco setup:     in module: "/Users/leif/rsrc/python/libpython.rkt"
raco setup:     internal name: void-if-not-available
raco setup:     compiling: <pkgs>/python/cpy-importing.rkt

ben
2018-3-28 18:39:34

@pnwamk I don’t see errors about bigtimes either. Do you get the same error with scribble/manual or scribble/sigplan?


leif
2018-3-28 18:40:02

And it looks like the relevant code is: (define-ffi-definer define-function (ffi-lib (and cpyimport-enabled path-to-cpython-lib)) #:default-make-fail void-if-not-available) (define-ffi-definer define-others (ffi-lib (and cpyimport-enabled path-to-others-lib)) #:default-make-fail void-if-not-available) (define-ffi-definer define-c-lang (ffi-lib #f) #:default-make-fail void-if-not-available) (define (void-if-not-available id) (lambda () void))


ben
2018-3-28 18:40:05

The problem might go away if you redefine \packageMathabx — but I don’t know what might be conflicting with Mathabx


leif
2018-3-28 18:40:52

It looks like there hasn’t been any recent changes to the ffi library (at least not that recent), which makes me think its probably some change with the VM. Any thoughts?


leif
2018-3-28 18:40:55

@mflatt ^


mflatt
2018-3-28 18:48:22

@ryanc Could your recent change to ffi/unsafe/define affect evaluation order? The code above doesn’t make sense, but the reference to void-if-not-available probably was previously under a conditional, and maybe’s not anymore. If that’s right, the new behavior is arguably better, as illustrated by the above example. I’m not immediately sure how to balance the improvement against backward compatibility here.


leif
2018-3-28 18:52:11

That would seem odd to me because weren’t those changes made several months ago?


pnwamk
2018-3-28 18:52:28

@leif


leif
2018-3-28 18:52:31

And the error only showed up the last time I pulled. Which was sometime in mid march.


pnwamk
2018-3-28 18:55:25

I do not see it with scribble/manual or scribble/sigplan


leif
2018-3-28 19:00:09

@pnwamk Hmm…that one also is the same.


leif
2018-3-28 19:00:26

I honestly don’t have any more ideas. I can’t seem to reproduce it on my machine. :disappointed:


ryanc
2018-3-28 19:12:39

@mflatt yes. The macro defined by define-ffi-definer used to copy the expression given as the default-make-fail argument to every definition (unless it was overridden). I changed it to bind the expression to a variable and copy the variable reference instead. So if all of the uses of define-function etc were after the definition of void-if-not-available it would work :confused:


pnwamk
2018-3-28 19:16:43

@leif @ben what version of TeX are you guys using? I’m on XeTeX 3.14159265–2.6–0.99998 (TeX Live 2017)


mflatt
2018-3-28 19:16:51

Ah, I was forgetting a level of indirection, so I see how the above code can make sense (but also why its behavior changed). Do you think it’s better to wrap the no-longer-copied expression, or is it better to conclude that make-ffi-definer needed to change its behavior?


pnwamk
2018-3-28 19:17:02

(I’m observing this both on Ubuntu and MacOS High Sierra)


ben
2018-3-28 19:17:42

texlive 2015


leif
2018-3-28 19:18:32

@pnwamk On OS X Yosemite, and whatever version comes with homebrew: TeX 3.14159265 (TeX Live 2015) kpathsea version 6.2.1 Copyright 2015 D.E. Knuth.


pnwamk
2018-3-28 19:18:52

hhhmmm…. perhaps it’s an issue w/ newer TeX versions?


leif
2018-3-28 19:19:25

@mflatt @ryanc Honestly I don’t think its a problem either way. The new behavior seems fine to me, but it should certainly be put in the changes list for the next release announcement.


leif
2018-3-28 19:20:21

What version are you using?


leif
2018-3-28 19:20:28

(Also adding @ben to the thread)


pnwamk
2018-3-28 19:22:17

2017


pnwamk
2018-3-28 19:22:36

it looks like you and Ben are on 2015


ben
2018-3-28 19:23:42

I’ll try to upgrade tonight & retry.


ryanc
2018-3-28 19:24:40

@mflatt @leif I suppose we could eta-expand to preserve the old evaluation order (when it matters) but avoid the actual expression duplication. I hadn’t expected anyone to be relying on the old behavior when I made the change.


leif
2018-3-28 19:25:51

Okay cool. Give it a go and tell us what happened.


leif
2018-3-28 19:25:58

Now, I do have an Ubuntu server I can check this out on.


leif
2018-3-28 19:26:15

Although it is 16.04…so it might still be way out of date.


leif
2018-3-28 19:26:41

Ah yup, sad: pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) kpathsea version 6.2.1 Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).


pnwamk
2018-3-28 19:26:47

I’ve observed it on MacOS High Sierra and Ubuntu 17.10, both of which have TeX 2017 installed


leif
2018-3-28 19:27:42

FWIW, this is the only package I have installed that seems to be relying on it. And honestly, its such a small change (move one line 4 lines up), that I don’t think it matters either way.


leif
2018-3-28 19:28:01

But eta-expanding would work for me. :slightly_smiling_face:


leif
2018-3-28 19:30:39

Hmm…okay.


leif
2018-3-28 19:30:48

Well I can set up a 17.10 VM.


leif
2018-3-28 19:31:04

(I don’t want to bump my server to 17.10 because its about to be end of lifed)


ryanc
2018-3-28 19:36:48

I’ll put that on my todo list for later this evening. @leif do you know if that code is still maintained?


leif
2018-3-28 19:37:38

Last commit was mid 2016. So….not heavily maintained.


leif
2018-3-28 19:38:41

I personally only use it fairly sparsely, generally for the lexer/parser.


ben
2018-3-28 20:30:49

redex question: redex-match is returning a list of 2 ~results that look identical to me~ equal? results. Should redex-match not be returning 2 results? The docs for redex-match don’t say it returns a list of unique matches, but thats the behavior I’ve been expecting. #lang racket/base (require redex/reduction-semantics) (define-language L (e ::= (+ e e) v (flip e)) (v ::= natural) (EP ::= hole (+ EP e) (+ v EP)) (E ::= EP (+ E e) (+ v E) (flip E))) (redex-match L (in-hole E (flip v)) (term (+ 2 (flip 2)))) ;; (list (match (list (bind 'E '(+ 2 #0=hole)) (bind 'v 2))) ;; (match (list (bind 'E '(+ 2 #0#)) (bind 'v 2))))


githree
2018-3-28 20:32:35

It seems I keep having compile-zo errors for other packages after all: https://groups.google.com/forum/#!topic/racket-users/kYk-x5Zn5EE Any ideas?


dan
2018-3-28 20:48:13

@ben I think you get 2 matches because there are 2 different ways to match that pattern from the grammar depending on whether E is first matched as an EP or as a (+ E e)


ben
2018-3-28 20:52:19

thanks, that makes sense. (I don’t want that first match to be possible, so I’ll think about how to rewrite)


leif
2018-3-28 21:54:58

@mflatt Would it be possible to update the version of Cairo we are using in Racket?


leif
2018-3-28 21:55:19

The existing version has a known bug with resizing empty glyphs on os x.


leif
2018-3-28 21:55:40

But the latest version (or the version that brew has at least), seems to have fixed this bug.



mflatt
2018-3-28 23:09:10

@leif I’ll look into upgrading


leif
2018-3-28 23:34:49

@mflatt Cool, thanks. It does look like the actual dylibs are stored in a different git repo, but since we split up the repos I’m no longer sure which one. :slightly_smiling_face:


leif
2018-3-28 23:34:52

Anyway, thanks.