sorawee
2019-8-22 10:24:30

I just finished 9 tasks in rosetta code. Now there are 1000 completed tasks!


soegaard2
2019-8-22 10:32:13

Nice! Team up with @tim986 and write a blog post.


soegaard2
2019-8-22 10:32:38

Is it possible to see a list of recently added Racket changes?


tim986
2019-8-22 10:34:55

I’ve been off the boil with regards to rosetta code :disappointed: But I’m really glad we’re forging ahead. And @sorawee: well done for getting this over the line… :parrot:


spratiksha0593
2019-8-22 10:46:34

@spratiksha0593 has joined the channel


sorawee
2019-8-22 11:47:16

Well, there’s https://rosettacode.org/wiki/Special:RecentChangesLinked/Category:Racket, but it will include changes of other languages as well.


sorawee
2019-8-22 11:49:32

The most reliable way is to use MediaWiki API to retrieve revisions before and after an edit in that page (or more generally https://rosettacode.org/wiki/Special:RecentChanges), and see if {{header\|Racket}} is added or not


soegaard2
2019-8-22 12:30:45

@sorawee Thanks. I was looking the wrong places.


alexharsanyi
2019-8-22 13:08:16

you can format time durations using either time-ticks or date-ticks, which allows customizing the format for the date and time values.


markus.pfeiffer
2019-8-22 13:19:53

You mean this: https://docs.racket-lang.org/plot/ticks_and_transforms.html ?

I completely missed that! thanks, I’ll check it out


sorawee
2019-8-22 13:52:20

@tim986 by the way, the Racket implementation for the popular programming languages task in Rosetta Code was buggy. I think you base your http://timb.net/popular-languages.html on that implementation, so it’s wrong as well.


sorawee
2019-8-22 13:52:45

In particular, it only shows languages whose count is less than 1000, and now that Racket has over 1000 pages, it’s gone!


sorawee
2019-8-22 13:53:46

I fixed it, basing on Python implementation. You can find it here: https://rosettacode.org/wiki/Rosetta_Code/Rank_languages_by_popularity#Racket


tim986
2019-8-22 13:58:58

thanks… why did it fail to get the >1000 ones?


sorawee
2019-8-22 14:00:37

Regex \d+ doesn’t match 1,000


soegaard2
2019-8-22 14:00:43

@spdegabrielle Do you have http://www.timb.net/popular-languages.html listed somewhere? (to give beginners ideas on small projects)


tim986
2019-8-22 14:07:24

which muppet put a comma in there :rolls-eyes:? Thanks for spotting that.


laurent.orseau
2019-8-22 14:15:36

@sorawee there’s one hash-refleft to turn into @ :wink: (I don’t have an account)


willbanders
2019-8-22 14:39:53

@sorawee Now you’ve made me want to implement 2048 using an SQL table xD


sorawee
2019-8-22 14:47:05

Fixed!


spdegabrielle
2019-8-22 14:48:05

Added


spdegabrielle
2019-8-22 14:48:20

@tim986 added to wiki


tim986
2019-8-22 14:51:28

Thanks guys… this is generated from a hand-crafted derivative of the implementation on rosetta code.

I’ll put some time in tonight (or maybe tomorrow) to make the source available — although it’s a bit too racket-centered to be put back onto RC itself.

I’ll also fix it up with the comma thing.


sorawee
2019-8-22 14:52:11

If Rosetta Code is a game, Racket is probably the most OP player. I mean, we can even claim that Racket is eligible for writing proofs (https://rosettacode.org/wiki/Proof), via #lang cur


soegaard2
2019-8-22 14:52:43

I am creating a new package latex-pict. I ran raco setup and raco setup --check-pkg-deps in order to see the dependencies, but nothing turns up. However: mbp:latex-pict soegaard$ cat *rkt \| grep require (require "tex.rkt") (require racket-poppler racket-poppler/render-tex So I expected racket-poppler to be listed.

What am I missing / doing wrong?


tim986
2019-8-22 14:53:04

What on earth is “Teacup rim text”? Seriously… I haven’t been on RC for too long!


spdegabrielle
2019-8-22 14:56:35

is http://bugs.racket-lang.org/ meant to be alive. DrRacket bug reporting is failing.



badkins
2019-8-22 15:11:41

Darn you - that’s just the type of program that tempts me :slightly_smiling_face:


spdegabrielle
2019-8-22 15:15:09


soegaard2
2019-8-22 15:21:22

Anyone willing to test this: https://pkgd.racket-lang.org/pkgn/package/latex-pict #lang at-exp racket (require latex-pict) (define $ tex-math) (define $$ tex-display-math) @${\sqrt{a^2+b^2}} @$${\sum_{n=1} \frac{1}{n^2}}


spdegabrielle
2019-8-22 15:21:29

I think part of the Rosetta code game is proposing tasks that are difficult in other programming languages….(i’m leaving this open for suggestions)


ruyvalle
2019-8-22 15:27:57

do you need the latest Racket version for this? I’m getting an error on 7.0 on Mac


soegaard2
2019-8-22 15:28:38

@ruyvalle I tested on 7.3. What’s the error?


ruyvalle
2019-8-22 15:34:33

open-input-file: cannot open module file module path: latex-pict path: /Users/ruyvalle/Library/Racket/7.0/pkgs/latex-pict/main.rkt system error: no such file or directory; rktio_err=3


ruyvalle
2019-8-22 15:35:26

oh wait sorry I just noticed raco pkg install reported errors during setup


ruyvalle
2019-8-22 15:36:50

racket-poppler wasn’t installed during installationo of latex-pict which caused errors during setup


soegaard2
2019-8-22 15:37:44

Does it say, why racket-poppler didn’t install?


ruyvalle
2019-8-22 15:38:53

no it doesn’t look like it


ruyvalle
2019-8-22 15:39:15

I could send you the output of raco pkg install if you want


soegaard2
2019-8-22 15:39:39

yes, thank you:


soegaard2
2019-8-22 15:40:07

Does raco pkg install racket-poppler work?


ruyvalle
2019-8-22 15:40:38

yes


soegaard2
2019-8-22 15:41:27

What does it say to: raco pkg install poppler-libs ?


ruyvalle
2019-8-22 15:43:04

raco pkg install poppler-libs Resolving "poppler-libs" via <https://download.racket-lang.org/releases/7.0/catalog/> Resolving "poppler-libs" via <https://pkgs.racket-lang.org> Resolving "poppler-libs" via <https://planet-compats.racket-lang.org> raco pkg install: cannot find package on catalogs package: poppler-libs


soegaard2
2019-8-22 15:45:33

That looks fine. Thanks for testing this. I’ll look at latex-pict again. I think I made a mistake in the info file - somewhere.


spdegabrielle
2019-8-22 16:03:20

Hi All, I thought I should make clear the goals of the summer pic competition: the idea is a) to engage new Racket users in achievable/rewarding tasks b) increase community engagement/cohesion in a stressful period of change c) promote Racket more broadly


spdegabrielle
2019-8-22 16:04:44

thanks @ben I was able to submit a bug with the old system but I can’t reproduce it now…very annoying.


soegaard2
2019-8-22 16:12:12

On the package server ( https://pkgd.racket-lang.org/pkgn/package/latex-pict ) it has picked up a new version: 3d720240fc8715356fc7af3d4b60cfa89d24cc64 Running raco pkg update latex-pict just used the cached version? Sanity check: mbp:latex-pict soegaard$ raco pkg show \| grep latex latex-pict 05e3409d1294... catalog...t.git


soegaard2
2019-8-22 16:12:25

Is there a trick to redownloading?


soegaard2
2019-8-22 16:28:23

@ruyvalle I changed the info file, uploaded. The package server is now updated, so I am interested in the result of raco pkg update latex-pict


ruyvalle
2019-8-22 16:39:42

looks good, no errors during install


ruyvalle
2019-8-22 16:39:48

running the code you posted earlier


ruyvalle
2019-8-22 16:40:27

open-input-file: cannot open module file module path: latex-pict path: /Users/ruyvalle/Library/Racket/7.0/pkgs/latex-pict/main.rkt system error: no such file or directory; rktio_err=3


ruyvalle
2019-8-22 16:41:02

just noticed that’s the same as earlier


soegaard2
2019-8-22 16:41:22

Can you check the version number? raco pkg show | grep latex


ruyvalle
2019-8-22 16:41:44

3d720240fc8715356…


ruyvalle
2019-8-22 16:42:20

I’m getting a different error actually. I don’t know why the very bottom of DrRacket is showing the same error as earlier. Probably a bug.


ruyvalle
2019-8-22 16:42:27

the new error is exec failed (No such file or directory; errno=2) . . call-with-input-file: cannot open input file path: /var/folders/43/rq0sv9hn5n78kjvpw6k7hn7r0000gn/T/latex2pdf-555e064de2de6fa1f45e105b63b9d449.log system error: No such file or directory; errno=2


soegaard2
2019-8-22 16:42:40

Much better!


ruyvalle
2019-8-22 16:43:04

and /var/folders/43/rq0sv9hn5n78kjvpw6k7hn7r0000gn/T/latex2pdf-555e064de2de6fa1f45e105b63b9d449.log indeed doesn’t exist


soegaard2
2019-8-22 16:43:17

exec failed - I think that means it couldn’t run pdflatex


soegaard2
2019-8-22 16:43:29

Do you have latex installed ?


ruyvalle
2019-8-22 16:43:38

I don’t think so


soegaard2
2019-8-22 16:43:59

Sorry - forgot to ask that upfront.


ruyvalle
2019-8-22 16:44:34

no worries, I could’ve realized it was required from the package name


soegaard2
2019-8-22 16:44:47

The package works by taking your math formula, generating a latex document, then calling latexpdf to make a pdf and then that pdf is turned into a pict.


soegaard2
2019-8-22 16:45:26

If you are game, I can recommend TeXLive (the mac version). It contains everything - but it is rather large.


soegaard2
2019-8-22 16:45:54

ruyvalle
2019-8-22 16:45:56

I am so curious about how that works. It’s like you’re using a Racket language with a partly non-Racket backend.


ruyvalle
2019-8-22 16:47:54

installing TeXLive now, it’ll take a while


soegaard2
2019-8-22 16:48:17

I make a simple tex document (ignore the ;;): ;; \documentclass{standalone} ;; \usepackage[active,tightpage,lyx,pdftex,&lt;modeoption&gt;]{preview} ;; \usepackage{amsmath} ;; &lt;your-preamble&gt; ;; \begin{document} ;; \( &lt;your-latex-snippet&gt; \) ;; \end{document} save it to a file, and then use system to start latexpdf. Then I read in the output file.


ruyvalle
2019-8-22 16:52:46

I was thinking of doing something similar with machine learning stuff and python. There’s so much effort put into ML and python, but I’d rather write in Racket. I thought translating Racket to Python would be useful. There’s a project that translates from Racket to Hy, and Hy is a Lisp-y language that gets translated to Python and then run. I got the impression that the Racket to Hy project didn’t cover much of Racket though.


soegaard2
2019-8-22 16:59:02

Sounds like you need a Python-FFI (like the C-ffi).


ruyvalle
2019-8-22 17:03:14

that’s a good idea!


soegaard2
2019-8-22 17:15:08

It is my impression that ML libraries in Python often contain bindings of C-libraries. For that type, it makes more sense to write bindings directly.

But if there is library written in Python, there is one way - somewhat involved: Use Python’s “CFFI for Embedding” to generate a C library, that can call the Python code. The write bindings in Racket for the generated C library. Bonus points if it can be automated.

https://cffi.readthedocs.io/en/latest/embedding.html


ruyvalle
2019-8-22 17:31:35

thanks!