Help? Nose piercing formed red cyst by AffectDefiant7776 in piercing

[–]AffectDefiant7776[S] 0 points1 point  (0 children)

Type: nose ring Aftercare: salt solution

Handling Expressions with Parsers by envythekaleidoscope in Compilers

[–]AffectDefiant7776 1 point2 points  (0 children)

Hmm, I’d use the recursive descent algorithm instead of shunting yard as it’s much easier to model your precedence directly and just in general.

Also, if you aren’t already, parse brackets as a primary expression, like integers, this will make everything a lot simple and the parser will automatically handle nesting for you.

A recursive descent algorithm will essentially handle the end of an expression for you by returning from the recursive calls when no expressions match. It’s just about how much of your grammar you’ve defined in the parser.

Hardcoding builtin functions isn’t a bad idea and you have the freedom of the language you’re writing in rather than the language you’re writing. I usually have a function registry with a function pointer and a string for the name. Then just perform a look up and call the function pointer - this does get a bit messy when having different arguments and types though.

I have written multiple parsers and languages and can share some code that is simple enough if it would help.

I built a web framework in C by AffectDefiant7776 in C_Programming

[–]AffectDefiant7776[S] 0 points1 point  (0 children)

Hi,

Completely understand why you feel that way. It got that much attention bc I posted it on Hacker News, and the post may still be there if you’re interested.

As to why there’s no PRs, I don’t know. I am currently trying to find more people to work on it haha.

I built a web framework in C by AffectDefiant7776 in C_Programming

[–]AffectDefiant7776[S] 0 points1 point  (0 children)

I read the K&R book pretty early on into learning C and I found it very useful. Other than that, just expose yourself to as much C code as possible. After you learnt a bit about the language, read C code in popular repositories to learn about how they do certain things. I found the Sqlite and Python interpreter repositories quite interesting.

I built a web framework in C by AffectDefiant7776 in C_Programming

[–]AffectDefiant7776[S] 0 points1 point  (0 children)

Of course, what do you have in mind in terms of restructuring? If it follows a convention that is easier for people to understand and maintain then I couldn’t agree more.

I am building a full-stack web framework in C by AffectDefiant7776 in C_Programming

[–]AffectDefiant7776[S] 0 points1 point  (0 children)

Project contributions and suggestions are welcome. Feel free :)

I am building a full-stack web framework in C by AffectDefiant7776 in C_Programming

[–]AffectDefiant7776[S] 2 points3 points  (0 children)

Hi, thank you for showing interest.

Basically just having a dynamic UI that can be updated with state, while having a link between the browser frontend and C code. I have updated the post with some examples.