# What are your thoughts on a VFS module?

**URL:** <https://forum.crystal-lang.org/t/what-are-your-thoughts-on-a-vfs-module/8670>\
**Category:** Community\
**Tags:** rfc\
**Created:** [January 26, 2026, 11:19am UTC](https://forum.crystal-lang.org/t/what-are-your-thoughts-on-a-vfs-module/8670 "2026-01-26T11:19:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![initd](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/initd/32/3182_2.png) [@initd](https://forum.crystal-lang.org/u/initd)\
**Post date:** [January 26, 2026, 11:19am UTC](https://forum.crystal-lang.org/t/what-are-your-thoughts-on-a-vfs-module/8670/1 "2026-01-26T11:19:30Z")

</div>

Hello, crystal community friends!

I’m glad to find a community where we can discuss. I’d like to share an issue I encountered.

I wrote a license generator with some YAML template files. It runs fine locally, but the single executable generated by CI doesn’t work properly. This is because it doesn’t embed these template files.

I also looked at some community libraries. I prefer using my own library, but when I import it into the project, I found it was completely unusable. Its API was completely inconsistent with the standard library.

While writing this, I realized there’s ECR. I looked at the source code and saw it has a lexer process, which isn’t the simple implementation I expected.

I noticed that Go has truly integrated the FS feature into its standard library.

Could Crystal provide a VFS abstraction layer?  
Implementing it myself revealed inheritance chain issues, and I remain uncertain about which APIs are truly essential to provide.

File handles offer atomic operations—an area I’m unfamiliar with.

With a VFS abstraction layer, we should be able to easily implement our own RoFS and MemFS.

---

<div class="post-metadata">

**Author:** ![ralsina](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/ralsina/32/2139_2.png) [@ralsina](https://forum.crystal-lang.org/u/ralsina)\
**Post date:** [January 26, 2026, 12:10pm UTC](https://forum.crystal-lang.org/t/what-are-your-thoughts-on-a-vfs-module/8670/2 "2026-01-26T12:10:09Z")

</div>

To embed files I have been using ralsina/baked\_file\_system (which is a small fork of schovi/baked\_file\_system)

I have a suspicion that it makes compile times longer if you embed a lot (because things are embedded as strings, which then are compiled) but will have to measure if that’s real.

If it is, then a objcopy-based solution is probably doable.

---

<div class="post-metadata">

**Author:** ![straight-shoota](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/straight-shoota/32/36_2.png) [@straight-shoota](https://forum.crystal-lang.org/u/straight-shoota)\
**Post date:** [January 26, 2026, 12:47pm UTC](https://forum.crystal-lang.org/t/what-are-your-thoughts-on-a-vfs-module/8670/3 "2026-01-26T12:47:50Z")

</div>

I figure for the specific use case, baked file system (or a similar solution) should be entirely sufficient. You can simply embed your template files into the executable.  
That’s simple and straightforward without unnecessary complexity.  
It’s also quite easy to use a layered approach to allow overriding the baked files with local paths (see [crinja/src/loader.cr at master · straight-shoota/crinja · GitHub](https://github.com/straight-shoota/crinja/blob/master/src/loader.cr), [crinja/src/loader/baked\_file\_loader.cr at master · straight-shoota/crinja · GitHub](https://github.com/straight-shoota/crinja/blob/master/src/loader/baked_file_loader.cr) for example).

A virtual file system abstraction is a much more complex feature and IMO only makes sense when you need to integrate different libraries using file system operations.

It could really be useful for the ecosystem. But for a simple app it’s over-complicating things.
