summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Benediktsson <mrjbq7@gmail.com>2022-03-25 10:28:02 -0700
committerJohn Benediktsson <mrjbq7@gmail.com>2022-03-25 10:28:02 -0700
commit2e92dcbc799dbb36229a7e90553953db33959adf (patch)
tree7ea9718c2ccc60d4224544fa07daf5a92dd48cb2
parent2d0307d5fa56c9de44e3f3fc8dfcec51e82c69c5 (diff)
svfig-talk: more updates
-rw-r--r--svfig-talk/svfig-talk.factor96
1 files changed, 50 insertions, 46 deletions
diff --git a/svfig-talk/svfig-talk.factor b/svfig-talk/svfig-talk.factor
index abb7cb8..871a48f 100644
--- a/svfig-talk/svfig-talk.factor
+++ b/svfig-talk/svfig-talk.factor
@@ -201,38 +201,6 @@ CONSTANT: svfig-slides
{ $code "\"cat\ndog\nfish\" [ readln ] with-string-reader" }
}
- { $slide "Assembly"
- "Access the Time Stamp Counter"
- { $code
-"HOOK: rdtsc cpu ( -- n )
-
-M: x86.32 rdtsc
- longlong { } cdecl [
- RDTSC
- ] alien-assembly ;
-
-M: x86.64 rdtsc
- longlong { } cdecl [
- RAX 0 MOV
- RDTSC
- RDX 32 SHL
- RAX RDX OR
- ] alien-assembly ;" }
- }
-
- { $slide "FFI"
- { $code "NAME
- sqrt – square root function
-
-SYNOPSIS
- #include <math.h>
-
- double
- sqrt(double x);" }
- "Let's use it!"
- { $code "FUNCTION: double sqrt ( double x )" }
- }
-
{ $slide "Destructors"
"Deterministic resource disposal"
"Any step can fail and we don't want to leak resources"
@@ -246,17 +214,6 @@ SYNOPSIS
}
}
- { $slide "Infix"
- { "Syntax experiments with " { $vocab-link "infix" } }
- "Infix word definitions:"
- { $code "INFIX:: foo ( x y -- z ) sqrt(x)+y**3 ;" }
- "Inline also:"
- { $code "[let \"hello\" :> seq"
- " [infix seq[::-1] infix]"
- "]"
- }
- }
-
{ $slide "Profiling"
{ $code
": fib ( m -- n )"
@@ -359,9 +316,9 @@ SYNOPSIS
"GENERIC: beats? ( obj1 obj2 -- ? )"
""
"METHOD: beats? { scissors paper } 2drop t ;"
- "METHOD: beats? { rock scissors } 2drop t ;"
- "METHOD: beats? { paper rock } 2drop t ;"
- "METHOD: beats? { object object } 2drop f ;"
+ "METHOD: beats? { rock scissors } 2drop t ;"
+ "METHOD: beats? { paper rock } 2drop t ;"
+ "METHOD: beats? { object object } 2drop f ;"
}
}
@@ -408,6 +365,49 @@ SYNOPSIS
"Object system is entirely implemented in Factor"
}
+ { $slide "Assembly"
+ "Access the Time Stamp Counter"
+ { $code
+"HOOK: rdtsc cpu ( -- n )
+
+M: x86.32 rdtsc
+ longlong { } cdecl [
+ RDTSC
+ ] alien-assembly ;
+
+M: x86.64 rdtsc
+ longlong { } cdecl [
+ RAX 0 MOV
+ RDTSC
+ RDX 32 SHL
+ RAX RDX OR
+ ] alien-assembly ;" }
+ }
+
+ { $slide "FFI"
+ { $code "NAME
+ sqrt – square root function
+
+SYNOPSIS
+ #include <math.h>
+
+ double
+ sqrt(double x);" }
+ "Let's use it!"
+ { $code "FUNCTION: double sqrt ( double x )" }
+ }
+
+ { $slide "Infix"
+ { "Syntax experiments with " { $vocab-link "infix" } }
+ "Infix word definitions:"
+ { $code "INFIX:: foo ( x y -- z ) sqrt(x)+y**3 ;" }
+ "Inline also:"
+ { $code "[let \"hello\" :> seq"
+ " [infix seq[::-1] infix]"
+ "]"
+ }
+ }
+
{ $slide "Implementation"
"VM in C++ (12,000 lines of code)"
"VM features primitives, garbage collection, etc."
@@ -434,6 +434,10 @@ SYNOPSIS
"Maintains stability"
}
+ { $slide "Demo"
+ "Let's look at a real program!"
+ }
+
{ $slide "Questions"
"It is hard to cover everything in a single talk"
"Factor has many cool things that I didn't talk about"