|
| 1 | +--- |
| 2 | +title: YAML gets YS in PHP, C#, Lua & Haskell |
| 3 | +date: 2025-07-11 |
| 4 | +draft: false |
| 5 | +authors: [ingydotnet] |
| 6 | +categories: [Summer-of-YS] |
| 7 | +edit: blog/2025-07-11.md |
| 8 | +comments: true |
| 9 | +--- |
| 10 | + |
| 11 | +YS is a YAML loader module. |
| 12 | +On one hand it does have super powers, |
| 13 | +but on the other hand it's just a plain YAML loader. |
| 14 | + |
| 15 | +A YAML loader is a utility that can turn YAML into a data structure. |
| 16 | +Every modern language has a YAML loader. |
| 17 | +Most have many. |
| 18 | + |
| 19 | +YS is the first YAML loader that was made for every programming language. |
| 20 | + |
| 21 | +Well that's the goal anyway. |
| 22 | + |
| 23 | +For the past year it's only had loaders for 11 languages: |
| 24 | +[Clojure](https://clojars.org/org.yamlscript/clj-yamlscript), |
| 25 | +[Crystal](https://shardbox.org/shards/yamlscript), |
| 26 | +[Go](https://github.com/yaml/yamlscript-go), |
| 27 | +[Java](https://clojars.org/org.yamlscript/yamlscript), |
| 28 | +[Julia](https://juliahub.com/ui/Packages/General/YAMLScript), |
| 29 | +[NodeJS](https://www.npmjs.com/package/@yaml/yamlscript), |
| 30 | +[Perl](https://metacpan.org/dist/YAMLScript/view/lib/YAMLScript.pod), |
| 31 | +[Python](https://pypi.org/project/yamlscript/), |
| 32 | +[Raku](https://raku.land/zef:ingy/YAMLScript), |
| 33 | +[Ruby](https://rubygems.org/search?query=yamlscript), and |
| 34 | +[Rust](https://crates.io/crates/yamlscript). |
| 35 | + |
| 36 | +Until this week, that is... |
| 37 | + |
| 38 | +<!-- more --> |
| 39 | + |
| 40 | + |
| 41 | +## This week it got four more! |
| 42 | + |
| 43 | +* [C#](https://www.nuget.org/packages/YAMLScript/) |
| 44 | +* [Haskell](https://hackage.haskell.org/package/yamlscript) |
| 45 | +* [Lua](https://luarocks.org/modules/ingy/yamlscript) |
| 46 | +* [PHP](https://packagist.org/packages/yaml/yamlscript) |
| 47 | + |
| 48 | +The YS language bindings are fairly simple. |
| 49 | + |
| 50 | +They are each an FFI binding to the `libys` shared library. |
| 51 | + |
| 52 | +Codewise they are only ~100-200 lines of code in any given language. |
| 53 | + |
| 54 | +In the past the YS team would find a person who was proficient in a language to |
| 55 | +write the binding. |
| 56 | + |
| 57 | +This week we decided to try a little AI. |
| 58 | + |
| 59 | +I wouldn't say it was a completely smooth process. |
| 60 | +Each one took several hours to complete. |
| 61 | + |
| 62 | +But in the grand scheme of things, if you can support a new language in a day, |
| 63 | +that feels like a win. |
| 64 | + |
| 65 | + |
| 66 | +## 42 Languages |
| 67 | + |
| 68 | +From the start of YS, the goal has always been to support at least 42 languages. |
| 69 | + |
| 70 | +Rosetta Code currently claims to have 973 languages. |
| 71 | + |
| 72 | +But I'm talking about languages that at least support JSON and have a library |
| 73 | +registry or package distribution system. |
| 74 | + |
| 75 | +I have a list of 45 candidate languages, each with a different registry, so I'd |
| 76 | +say 42 is a reachable goal. |
0 commit comments