Posts

Showing posts with the label c

Upcoming Guest Opinions Post!

Image
  Hello everybody, Sometime in the next few days I am planning my first guest opinions post! This format will consist of me and a couple of friends each writing a little on a question, and then a little conclusion! Maybe at some point down the line, you guys can write a paragraph too! So here's the first motion, if you will! " Is C a useful skill in 2023? " We will examine views from multiple angles of the programming spectrum. Lined up to contribute, I have myself, my web dev friend, and a more Python angled developer! What do you think of this hot question? Feel free to post your answer in the comments section below!

Writing LiveC - a C REPL written in V

Image
In this post, I will explain how I wrote LiveC, my latest project. I used V, one of my favourite up-and-coming languages. I like the way the syntax is easy to learn, and the principles logical, but also the fact that compilation to C enhances speed and increases portability.  I was inspired to make this project by a similar one I saw online, namely crepl . I thought it would be an interesting challenge, and I had also previously thought that a C live shell would be useful. So I set off. As with most projects I write, the first thing I did was to setup the that we would be working on. struct Function { def string source string } struct LiveC { mut : functions [] Function main_func string spaces int first string } Once I had done this, I began to write the methods that we would call on these classes. My first draft of the code, which didn't use highlighting yet, took input from the user, before checking if it was a function. If so...