I created this project in VSCodium as a starting point for my own Odin learning and development journey. I am sharing it here because I think it may be useful for absolute beginners (like me) to get started with Odin once they have installed the compiler.
For VSCode or VSCodium users,
- A list of essential extentions
- A task config for building and running the
- application
- test suite
- A launch config for debugging the
- application
- test suite
- A simple
Makefilethat powers the configs above ^
-
odincompiler in yourPATH. Please follow their docs to make sure you have odin and its pre-requisites installed. -
lldbin yourPATH.llvmis a pre-requisite ofodinandlldbcomes bundled withllvmreleases, so chances are you already have it. -
makein yourPATH.
This is only a starter template. Simply fork/clone/download/degit this repo to get started!
Once you open the project in VSCode it should prompt you to install the recommended extentions. Please allow it to install. This might take a while.
Once the extentions are intalled and initialised, the OLS extention will probably ask you to specify an ols.json file. If one doesn't exist yet, you can ask it to generate a new file from within the same prompt.
It should look similar to the ols.sample.json file provided. You can modify & rename the sample file as well if you like, rather than asking the OLS extention to generate one for you.
Please have a read of the Makefile to understand what is going on. You may want to change the name of the output file/executable. If you do so, please make sure you have also updated the .vscode/launch.json file since the debug launch configurations explicitly mention the file name.
You can now continue using the make command (as God intended), or use VSCode's command palette to start tasks.
That's it! Have fun!
The code in the src folder in this repo is simply an exaggerated version of a 'hello-world' program which demonstrates the following:
- code organisation in packages
- string comparison and formatting
- simple unit testing in Odin