[rebuttal] printf in other languages
This commit is contained in:
parent
5cd1971004
commit
e4cc578b5e
6
icfp-2016/src/.gitignore
vendored
Normal file
6
icfp-2016/src/.gitignore
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
*.hi
|
||||
*.hs
|
||||
*.cmi
|
||||
*.cmo
|
||||
*.out
|
||||
*.class
|
8
icfp-2016/src/printf/Printf.java
Normal file
8
icfp-2016/src/printf/Printf.java
Normal file
|
@ -0,0 +1,8 @@
|
|||
public class Printf {
|
||||
public static void main(String[] args) {
|
||||
A a = new A();
|
||||
System.out.printf("yolo %d\n", a);
|
||||
}
|
||||
}
|
||||
|
||||
class A {}
|
13
icfp-2016/src/printf/README.md
Normal file
13
icfp-2016/src/printf/README.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
printf
|
||||
===
|
||||
|
||||
#### What languages have type safe printf?
|
||||
- gcc (warning)
|
||||
- ocaml (warning for missing args, error for wrong type)
|
||||
|
||||
|
||||
#### What languages fail at runtime?
|
||||
- Java (alt: string builder)
|
||||
- Scala (alt: scala macros)
|
||||
- Haskell (alt: [Formatting](http://chrisdone.com/posts/formatting) package)
|
||||
- Python
|
6
icfp-2016/src/printf/printf.c
Normal file
6
icfp-2016/src/printf/printf.c
Normal file
|
@ -0,0 +1,6 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
printf("yo %d", "lo");
|
||||
return 0;
|
||||
}
|
4
icfp-2016/src/printf/printf.ml
Normal file
4
icfp-2016/src/printf/printf.ml
Normal file
|
@ -0,0 +1,4 @@
|
|||
let _ =
|
||||
Format.printf "yo %d\n";
|
||||
Format.printf "yo %d\n" "lo";
|
||||
()
|
Loading…
Reference in New Issue
Block a user