jjlammi
2021-3-13 14:08:14

Sunrise and sunset times, noon time, max elevation for any location coordinates (latitude & longitude) and any date & time https://github.com/jarmol/racket I would make a web version for racket if I could, similar to this one which I made in elm-language http://www.sci.fi/~benefon/sunposcalculator.html


sorawee
2021-3-13 14:15:55

There’s RacketScript which can compile Racket to JS. https://github.com/vishesh/racketscript

It’s pretty experimental though. Can’t guarantee that it will work for your code.


soegaard2
2021-3-13 15:06:38

@jjlammi It happens periodically that the server needs restarting.


soegaard2
2021-3-13 15:07:33

Send a mail to Vishesh or @stchang


jjlammi
2021-3-13 15:10:14

Playground is either stopped or dead. whois : No match for domain "http://RAPTURE.TWISTEDPLANE.COM\|RAPTURE.TWISTEDPLANE.COM".


soegaard2
2021-3-13 15:23:36

jjlammi
2021-3-13 15:41:17

@soegaard2 urlang looks interesting too!


soegaard2
2021-3-13 15:42:19

Thanks! I’d be happy to answer questions - the documentation is unfortunately next to non-existant, but there are some examples.


jjlammi
2021-3-13 15:51:14

@soegaard2 I’ll test it, how it translates from racket to JS. I like just that kind of tiny examples as procedure fact preferring them instead of some huge examples like blog managers and todo lists which are always more or less boring and where you finally don’t learn much because they are too complicated for a beginner.


soegaard2
2021-3-13 15:56:38

Note that with (require urlang/extra) you use some of the standard Racket constructs missing from JavaScript, such as when, unless, cond, case, letrec and a version of for.


soegaard2
2021-3-13 15:57:20

jjlammi
2021-3-13 16:10:17

@soegaard2 Yesss, it works in deed! :+1:


soegaard2
2021-3-13 16:31:02

@jjlammi


soegaard2
2021-3-13 16:31:58

For programs that can run in Node directly, it can be convenient to set current-urlang-run? to #t


soegaard2
2021-3-13 16:32:23

Running the Racket program will then automatically run the generated JavaScript with Node.


jjlammi
2021-3-13 18:08:32

@soegaard2 OK, mean while I have first run with simple (require urlang) without option extra and using drRacket, then it has apparently not run fact,js but I found afterwards the file created. Next I have run it from bash command line with racket, then the created js code was displayed in shell window and executed factorial calculation ok. Your urlang tool may be very useful also in some bigger projects which can be divided into small pieces and compiled. The remaining tricky pieces can be manually written in js Then you hopefully have at the end lots of cleaner functions and a package easier to test and maintain, so as the elm people claim (quite few in the world except in Norway). Well, I don’t anything useful with any programming languages as I’m not a developer, just interested in functional programming, having lots of time learning it as retired.


spdegabrielle
2021-3-13 22:23:06

I believe the published RacketScript currently only works on versions of racket prior to the introduction of linklets https://docs.racket-lang.org/reference/linklets.html\|https://docs.racket-lang.org/reference/linklets.html


spdegabrielle
2021-3-13 22:27:34

I believe @stchang is leading the work to upgrade it.