Below are some frequently asked questions that new users of the FOFI language and its compiler might encounter. If you don't see your question here, feel free to open an issue or reach out on our discussion boards.
Currently, we haven't fully tested the compiler on Windows. Some users have reported success using WSL2 with Ubuntu. We plan to add Windows support in upcoming releases, but for now, WSL2 is the safest bet.
Make sure you're running the compiled JavaScript (.fofi.js
) in Node.js, not a browser environment. FOFI's code generation expects a Node-like environment by default.
Ensure your Cabal is up to date. Try:
cabal update
Then re-run the build steps documented in README.md. If problems persist, you may need to upgrade GHC (we recommend GHC 8.10+).
Your system PATH may not include Cabal's bin path. Check your shell configuration (.bashrc
, .zshrc
, etc.) and make sure something like ~/.cabal/bin
is in your $PATH
.
FOFI's parser is sensitive to keywords and punctuation (like semicolons, parentheses). A small deviation can cause parse errors. Verify your syntax carefully or consult docs/README.md for syntax references.
FOFI's code generator is not optimized for minimal size or readability. It emphasizes correctness first. You can use a minifier or bundler if you want to shrink the output.
We're actively discussing the possibility of providing an interactive environment. This would likely come after we stabilize the compiler features.
Yes. Although still limited, you can define them as separate modules or expansions in the grammar. We intend to add a dedicated syntax for user-defined types soon.
Not yet in the official grammar. We rely on if-else constructs or function expansions to handle branching. Pattern matching is on the roadmap.
Currently, no. Our focus is on simpler imperative constructs and some functional purity. We do have partial internal handling of closures (a stepping stone to lambdas), but it's not user-facing.
We lack a formal debugger, but you can insert mostrar(...)
statements throughout your code or rely on node inspection tools on the generated JavaScript. Also, watch the compiler output for warnings.
This is a known shortcoming. We'd like to improve error messages to show file name, line number, and more.
It's under consideration. The language, in theory, can be extended with concurrency primitives or messages. However, we want to ensure we have a robust single-threaded foundation first.
Yes, but that's after we've stabilized the standard library design. We see the need for a package manager akin to npm or cargo for stable distribution of FOFI libraries.
Please open an issue in our GitHub repository. The more details you include (OS, GHC/Cabal versions, minimal code snippet) the faster we can fix or address your request.
We hope this FAQ helps you navigate FOFI's quirks and potential pitfalls. If you're still stuck, feel free to reach out. Happy coding!