this post was submitted on 14 Sep 2023
6 points (87.5% liked)
C Programming Language
936 readers
2 users here now
Welcome to the C community!
C is quirky, flawed, and an enormous success.
... When I read commentary about suggestions for where C should go, I often think back and give thanks that it wasn't developed under the advice of a worldwide crowd.
... The only way to learn a new programming language is by writing programs in it.
- irc: #c
🌐 https://en.cppreference.com/w/c
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
No, the #! is the input to an Interpreter that is written in C. The rest of the file is in "calculator language" (sort of like an HP41C but labels are merged with steps and variables take up one step each but are named so you can have as many as you like). The
I am not getting this, but anyway, I am writing an interpreter in C to run a program written in "Calculator Language"
What are you saying? I think that word was supposed to be "implementation", but what is a "FILE define"? The interpreter won't have the name of the file, will it?
One thing I might do is provide the name of the calculator language file in the shebang so the interpreter sees it..
This is the start of a file in calculator language named fizbuz.lnc :
#! /bin/lincalc fizbuz.lnc
The interpreter would see this first line on its standard input and stop reading standard input, and open the file "fizbuz.lnc" but this is non-standard for a shbang line. Also, this won't work if the shebang is stripped off the input by the shell and not provided to the called program.