🔍 Spot the difference? Both define an outer function (plus). Both return an inner, anonymous function. Both "close over" the variable in the parent scope. R uses environments; Perl uses lexicals. Same logic, different syntax. 🤝 #FunctionalProgramming #CodingTips #ComputerScience #RStats #Perl 3/3
#perl sub plus { my ($x) = @_; sub { my ($y) = @_; $x + $y } } my $plus_one = plus(1); $plus_one->(10); # 11 #FunctionalProgramming #CodingTips #ComputerScience #RStats #Perl 2/
💡 R and #Perl are more alike than you think!Both use lexical scoping to create closures. The inner function "captures" the variable from the outer scope, creating a persistent environment. #rstats plus <- function(x) { function(y) x + y } plus_one <- plus(1) plus_one(10) #11 1/
The Weekly Challenge 367: Binary Conflict

I’ve been doing the Weekly Challenges. The latest involved bit rearrangement and range overlaps. (Note that this ends today.)

RogerBW's Blog
One Open-source Project Daily

Enjoy the mysteries of the sea from the safety of your own terminal!

https://github.com/cmatsuoka/asciiquarium

#1ospd #opensource #perl
GitHub - cmatsuoka/asciiquarium: Enjoy the mysteries of the sea from the safety of your own terminal!

Enjoy the mysteries of the sea from the safety of your own terminal! - cmatsuoka/asciiquarium

GitHub

I'm learning #Rust now and am surprised that my #Perl experience is perhaps more valuable than JavaScript / TypeScript experience to understand some of the concepts. Why:

- Perl has more explicit reference handling
- Perl has Moose::Roles which have some similarities in Rust traits. I haven't run into a similar pattern as much in JavaScript / TypeScript.

@me I really need to write about how we (still) use #perl and CGI to run our entire web infrastructure for 1000s of daily users.
Just merged the go-based branch of #convos (web based irc client) to main, planning to do a stable release in a week or two. Other than a total rewrite of the backend from #perl to #go, the main interesting features are oidc SSO and proper webpush notifications working on android and ios. If you want to test the new release, the alpha images are now built using go https://github.com/convos-chat/convos/pkgs/container/convos - the svelte frontend remains more or less unchanged, will probably be upgraded to a more recent svelte and retouched for v10
Build software better, together

GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

GitHub
So glad #perl DateTime.pm have a $dt->truncate( to => ... ) method. Makes possible to alter a date to a "close" value, e. g. ->truncate( to => 'day' ) and a DateTime that's set to 3:54PM would be "reset" to the same day, 00::00:00AM.

Playing around with #starman and #dancer2, since apparently no one uses #perlcgi any more.

If anyone can recommend some beginner resources, I'd appreciate it, specifically around form processing and DB interactions.

#perl #selfhosting #selfhosted #webcrafting #webserver