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

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

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

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 has joined the channel

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

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

@sorawee Thanks. I was looking the wrong places.

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

You mean this: https://docs.racket-lang.org/plot/ticks_and_transforms.html ?
I completely missed that! thanks, I’ll check it out

@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.

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

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

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

Regex \d+
doesn’t match 1,000

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

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

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

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

Fixed!

Added

@tim986 added to wiki

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.

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

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?

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

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


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



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}}

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)

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

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

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

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

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

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

no it doesn’t look like it

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

yes, thank you:

Does raco pkg install racket-poppler
work?

yes

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

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

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.

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

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

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

Is there a trick to redownloading?

@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

looks good, no errors during install

running the code you posted earlier

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

just noticed that’s the same as earlier

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

3d720240fc8715356…

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.

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

Much better!

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

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

Do you have latex installed ?

I don’t think so

Sorry - forgot to ask that upfront.

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

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.

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


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

installing TeXLive now, it’ll take a while

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

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.

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

that’s a good idea!

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.

thanks!