Just getting back to the AI generation of a YS program that uses AI to generate Clojure. It totally worked of course:
$ ys clojure-generator.ys fizzbuzz.clj
Describe the Clojure program you want: Write a program that does Fizzbuzz.
Generating Clojure program...
$ cat fizzbuzz.clj
(defn fizzbuzz [n]
(doseq [i (range 1 (inc n))]
(cond
(zero? (mod i 15)) (println "FizzBuzz")
(zero? (mod i 3)) (println "Fizz")
(zero? (mod i 5)) (println "Buzz")
:else (println i))))
(fizzbuzz 100)
$ bb fizzbuzz.clj | head -n16
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
$
https://gist.github.com/ingydotnet/fabadf655f95b2e3574bd2ed815380cb$ gloat fizzbuzz.clj && ./fizzbuzz | head -n16
Converting directory /tmp/30b5cb89-d1d3-4510-b2b2-e09b82b6b36a13153479626892729690 to /tmp/1ade9182-8658-42e8-980f-ff69f5dbd37e15813143403364602379/build
Found 1 source file(s)
Converting fizzbuzz.clj ...
Compiling main.core ...
Main namespace: main.core
Go module:
Generated: /tmp/1ade9182-8658-42e8-980f-ff69f5dbd37e15813143403364602379/build/go.mod
Generated: /tmp/1ade9182-8658-42e8-980f-ff69f5dbd37e15813143403364602379/build/main.go
Building bin ...
Generated: fizzbuzz
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
$ brave new world
Indeed!
I've enjoyed watching all your progress!
I got a new one for you in a couple minutes!!!
@neumann the 0.1.12 broswer example in #yamlscript is the "new one"
Gloat 0.1.12 just released:
$ gloat demo/yamlscript/dragon-curve.ys -o dragon-curve.js -Xprune,open='125'
Converting directory /tmp/f7964ce9-a571-48f9-ba2b-e8878f4eabd711673160170725405029 to /tmp/91220635-535a-4770-bcb1-c131928cb0ab8924059107346610625/build
Found 1 source file(s)
Converting dragon-curve.ys ...
Compiling dragon_curve.core ...
Main namespace: dragon_curve.core
Go module:
Generated: /tmp/91220635-535a-4770-bcb1-c131928cb0ab8924059107346610625/build/go.mod
Pruned clojure.core: 235/695 functions kept (460 removed)
Pruned ys.dwim: 1/46 functions kept (45 removed)
Pruned ys.std: 14/165 functions kept (151 removed)
Pruned yamlscript.common: 2/4 functions kept (2 removed)
Pruned ys.v0: 8/216 functions kept (208 removed)
Pruned yamlscript.util: 1/9 functions kept (8 removed)
Generated: /tmp/91220635-535a-4770-bcb1-c131928cb0ab8924059107346610625/build/main.go
Building js ...
Generated: dragon-curve.js
Generated: dragon-curve.html
When server has started, open:
Opens browser tab with: