Re: Article suggestion (note for admin)
We have many STDs. stdio stdlib libstdc++ On Tue, Nov 7, 2023 at 7:57 AM Dwayne Jacobs < d.jac...@backgroundchecksmailing.org> wrote: > Hi GCC Team, > > I wanted to follow up once more regarding the latest STD statistics in the > US. > > As I mentioned previously, I believe the data could be a useful resource > for your audience. > > You can find the full report here: > https://backgroundchecks.org/which-states-have-the-most-stds.html > > If you're the person who updates your page, would you be open to including > our updated report? > > Let me know your thoughts, > > Dwayne Jacobs > Director of Public Outreach > BackgroundChecks.org > d.jac...@backgroundchecksmailing.org > > > If you don't think this resource would be helpful, just reply with > “unsubscribe." >
Re: Using gcc as a sort of scripting language.
On Sat, Dec 28, 2024 at 2:48 PM Florian Weimer wrote: > [...] > > > Still it would be a nice touch if we could do > > #!/usr/bin/gcc -f > #include > int main() > { > puts("Hello, world"); > return 0; > } > re previously mentioned "root" >>> cat d #include int main(void) { puts("Hello, world, you can ignore all that particle physics if you like.\n"); return 0; } >>> root -b https://root.cern | | (c) 1995-2024, The ROOT Team; conception: R. Brun, F. Rademakers | | Built for linuxx8664gcc on Dec 15 2024, 18:15:13 | | From tags/6-34-02@6-34-02| | With c++ (GCC) 14.2.1 20241214 | | Try '.help'/'.?', '.demo', '.license', '.credits', '.quit'/'.q' | -- Hello, world, you can ignore all that particle physics if you like. (batch mode)
Re: Using gcc as a sort of scripting language.
>>> cat e #!/bin/sh # # root -l -b < int main(void) { puts("Hello, world, you can ignore all that particle physics if you like."); printf("By the way, log(2025) is %lf\n",log(2025.)); printf("Here I have suppressed the banner\n"); return 0; } DOIT >>> ./e Hello, world, you can ignore all that particle physics if you like. By the way, log(2025) is 7.613325 Here I have suppressed the banner
Re: Using gcc as a sort of scripting language.
Does "root" do what you want? https://root.cern/ https://root.cern/primer/#learn-c-at-the-root-prompt Includes a c++ interpreter (which includes all of C) that interprets C as you go, then at your option, compile a just-interpreted function, dynamically link it, and use the compiled version of that function in further interpreted commands. I think this (root) is under-appreciated or unknown by C community. On Sat, Dec 28, 2024 at 3:49 AM Basile Starynkevitch < bas...@starynkevitch.net> wrote: > Hello all, > > Paul Markfort suggested > > > > This is just a suggestion to make it easier for Linux/Unix users to > > use the Gnu compilers instead of having to use a scripting language > > for short little utilities. > > > > I know someone has created and released a binary C interpreter for > > this purpose. > > But why would you want to install another program, if you could > > essentially use the tools you already have. > > > > I think gcc (and all the compilers) should support the "#!" in source > > files to make something similar easily possible. > > > I agree with that suggestion. > > On Linux, there are limitations given by execve(2) system call. > I observe that Clang/LLVM people might disagree with it. > > One of the issues is that we could want several C files compiled into > one shared library. > > Another of the issues is that we could want to specify different code > generation or optimizations. Perhaps the second non comment line could > be some #pragma. > > GCC allows the standard input to be used. > > Maybe a possibility might be to have a /usr/bin/gcc-stdin executable? > > Observe that tinycc (a quick non-optimizing open source C compiler) > already has the wanted feature > https://en.wikipedia.org/wiki/Tiny_C_Compiler > > > TCC-DOC(1)Tiny C Compiler > > TCC-DOC(1) > > > > NAME > >tcc - Tiny C Compiler > > > > SYNOPSIS > >usage: tcc [options] [infile1 infile2...] [-run infile > > args...] > > > > DESCRIPTION > >TCC options are a very much like gcc options. The main > > difference is that TCC can also execute directly the > >resulting program and give it runtime arguments. > > > >Here are some examples to understand the logic: > > > >"tcc -run a.c" > >Compile a.c and execute it directly > > > >"tcc -run a.c arg1" > >Compile a.c and execute it directly. arg1 is given as > > first argument to the main() of a.c. > > > >"tcc a.c -run b.c arg1" > >Compile a.c and b.c, link them together and execute them. > > arg1 is given as first argument to the main() > >of the resulting program. > > > > > Best wishes for 2025. > > PS my open source project is a GPL inference engine on > https://github.com/RefPerSys/RefPerSys/ > > > -- > Basile STARYNKEVITCH > 8 rue de la Faïencerie > 92340 Bourg-la-Reine, France > http://starynkevitch.net/Basile & https://github.com/bstarynk > >