o
odinpkg.dev
packages / library / odin-practice

odin-practice

252423clibrary

๐Ÿ‘‘ Learning Odin because it's a simple sysprog lang with the convenience of Go. (Feels like a Rust + Zig + Go baby).

No license ยท updated 1 year ago

๐Ÿš€ Odin Practice

Learning Odin because I wanna get into low-level programming and do some cool stuff with it.

This technically follows the Odin documentation coincidentally.

Projects on this repo:

  1. Hello World - Odin basics. (Like node index.js) - odin run main.odin
  2. Hello Package - Odin basics + Package Management. (Like npm run dev)
  3. Guessing Game - Random number generate, then take user input until random number is guessed.
  4. Salary - Console app that estimates salary based on hourly, daily, monthly, and yearly rates.
  5. Tried Passwords CLI - Recreation of my Go implementation.
  6. HTTP Server - Simple HTTP server to understand networking and concurrency in Odin.
  7. Server - API Server with Odin's standard HTTP libraries.
  8. API Server - Type-safe API Server using Odin's type system.
  9. TCP Socket Chat - A console-based chat application using sockets to understand network communication.
  10. Random Quotes - A simple CLI application that fetches a random quote from the API Ninjas Quotes.
  11. Tic Tac Toe - A simple Tic Tac Toe game with persistence.
  12. WebSocket Chat - A console-based chat application using WebSockets to understand network communication on browser.
  13. Static Site Generator - Converts markdown to HTML.
  14. GUI App - Native GUI application using Odin's bindings.
  15. Basic GUI - A simple GUI program using Odin's GUI libraries.
  16. GUI Input - A simple input field with Odin's GUI libraries.
  17. Todo GUI Application - A simple GUI application to manage tasks.

Notes

  • Install Odin by cloning the repository and building from source, or downloading pre-built binaries. Or brew install odin
  • CLI's you need to know: The odin command handles compilation and running
  • odin run . probably your main feedback loop command in a project (finds main.odin).
  • odin run <file> -file compile and run a specific odin file.
  • odin build <file> -file to compile only
  • odin check <file> to type check without compiling
  • odin run -file <file> to specify input file
  • odin build -out:<name> to specify output name
  • odin run -debug for debug builds
  • odin build -release for release builds
  • odin run -show-timings to see compilation timings
  • Collections are handled through the core library
  • Package management is done through git submodules or local paths

Terminologies

  • Package - A collection of Odin source files
  • Procedure - Function declaration with proc
  • Struct - Custom data type definition
  • Union - Tagged union type
  • Enum - Enumerated type
  • Import - Bringing in other packages with import
  • Foreign - External C code linkage