In this post, I'll address two subjects:
-
How to solve HVM's quadratic slowdown compared to GHC in some cases
-
Why that is relevant to logic programming, unification, and program search
f : {a : Type} -> a -> a | |
f {a=Int} x = 2 * x | |
f {a=String} x = "twice " ++ x | |
f {a=_} x = x | |
main : IO () | |
main = do | |
-- Ad-hoc polymorphism type 1: type-based overloading | |
-- Also in: C++, Java | |
printLn $ "hi " ++ "there" -- uses the ++ for String |
Now that pkgin has refresh support and the macOS trunk builds have proven that a rolling trunk release works well, I am happy to make SmartOS/illumos trunk packages and images available again for testing.
These are rolling builds of pkgsrc trunk every day (or so), providing the latest packages without having to upgrade across quarterly releases. Just install once then pkgin full-upgrade
to keep up-to-date.
This is primarily of interest to:
{ config, lib, pkgs, ... }: with lib; | |
{ | |
### SmartOS Linux Branded Zone specific configuration | |
boot.isContainer = true; | |
boot.loader.initScript.enable = true; | |
networking.useDHCP = false; | |
networking.firewall.enable = false; | |
services.nscd.enable = true;# false; |
#!/bin/bash -e | |
# Creates a systemd-nspawn container with Alpine | |
MIRROR=http://dl-cdn.alpinelinux.org/alpine | |
VERSION=${VERSION:-v3.21} | |
APKTOOLS_VERSION=2.14.6-r3 | |
wget_or_curl () { | |
if command -v wget >/dev/null; then |
This is my attempt to give Scala newcomers a quick-and-easy rundown to the prerequisite steps they need to a) try Scala, and b) get a standard project up and running on their machine. I'm not going to talk about the language at all; there are plenty of better resources a google search away. This is just focused on the prerequisite tooling and machine setup. I will not be assuming you have any background in JVM languages. So if you're coming from Python, Ruby, JavaScript, Haskell, or anywhere… I hope to present the information you need without assuming anything.
Disclaimer It has been over a decade since I was new to Scala, and when I was new to Scala, I was coming from a Java and Ruby background. This has probably caused me to unknowingly make some assumptions. Please feel free to call me out in comments/tweets!
One assumption I'm knowingly making is that you're on a Unix-like platform. Sorry, Windows users.
# first we download the list of IP ranges from CloudFlare | |
wget https://www.cloudflare.com/ips-v4 | |
# set the security group ID | |
SG_ID="sg-00000000000000" | |
# iterate over the IP ranges in the downloaded file | |
# and allow access to ports 80 and 443 | |
while read p | |
do |
const I = x => x | |
const K = x => y => x | |
const A = f => x => f (x) | |
const T = x => f => f (x) | |
const W = f => x => f (x) (x) | |
const C = f => y => x => f (x) (y) | |
const B = f => g => x => f (g (x)) | |
const S = f => g => x => f (x) (g (x)) | |
const S_ = f => g => x => f (g (x)) (x) | |
const S2 = f => g => h => x => f (g (x)) (h (x)) |