Show HN: Nibble

  • Notifications You must be signed in to change notification settings
  • Fork 0
  • Star 5
  • Code
  • Issues 1
  • Pull requests 0
  • Actions
  • Projects
  • Security and quality 0
  • Insights
Additional navigation options  masterBranchesTagsGo to fileCodeOpen more actions menu

Folders and files

NameNameLast commit messageLast commit date

Latest commit

History

104 Commits104 Commits
chickenschickens  
imgimg  
liblib  
shadersshaders  
testtest  
treetree  
MakefileMakefile  
README.mdREADME.md  
main.cmain.c  
View all files

Repository files navigation

  • README

Show HN: Nibble

Nibble is C-like systems programming language.

Show HN: Nibble

Nibble was written in 3000 lines of C to demonstrate an approach to LLVM IR generation without relying on external dependencies or heap allocations.

Show HN: Nibble

Nibble supports defer, recursion, integer, floating, and boolean types, structs (simply named types), GLSL-like struct operators, pointers, function pointers, branching, loops, type checking, basic C interoperability via generic pointers, and reasonable error messages.

Show HN: Nibble

Included are these four graphical demos demonstrating Nibble's ability. To try them out, ensure SDL2 is first installed, as well as Clang, and then run make. Clang will compile main.c and output the nibble compiler, and nibble will then compile and run the graphical demos. Of these four demos, two demos are multithreaded software renditions of popular shader-toy demos, one demo is a demonstration of a red-black tree implementation, and the final demo demonstrates a basic setup for game programming.

Show HN: Nibble

Nibble compiles top down in a single pass and allocas freely, even within loops, by design. This simplified front-end design greatly improves main.c readability but causes stack overflows with lower (and sometimes even higher) clang back-end optimizations. I was under the impression clang's back-end optimizer would hoist all allocas to a function's top level, but so we learn in life. I have been meaning to explore stacksave/stackrestore but my LLVM curiosity has more or less been satisfied, and I deem this compiler momentarily complete.

About

Generating LLVM IR without malloc or external dependencies

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

5 stars

Watchers

0 watching

Forks

0 forks Report repository

Releases

No releases published

Packages 0

     

Uh oh!

There was an error while loading. Please reload this page.

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

  • C 55.6%
  • Nemerle 25.2%
  • Roff 18.2%
  • Makefile 1.0%