GP2C(1)

πŸ’– GP2C β€” bestie edition πŸ’–

okay so this is a PARI manpage, and the whole thing is literally about GP2C, aka The GP to C compiler. pull up a chair, grab a boba, we're doing this πŸ§‹βœ¨


✨ NAME ✨

GP2C β€” the GP to C compiler 🫢


🌸 SYNOPSIS 🌸

gp2c [-ghfltvydWSTGV] [-i N] [-o <file>] [-p <prefix>] [file.gp]

πŸ’… DESCRIPTION πŸ’…

gp2c is a program that translates GP code into C code that uses the libpari library. it literally tries to generate code that looks like the PARI source code. main character energy fr πŸ’–

πŸŽ€ user option:

  • -o <file> β€” place output in file <file>. yes bestie, your code goes here now πŸ’Œ
  • -g β€” generate automatic garbage collection code. let the machine clean up after itself, iconic 🧹✨
  • -iN β€” set the indentation level to N spaces (default 2). two spaces is the vibe, but you do you πŸ’…
  • -W β€” output warning about types and global variables usage. she's keeping receipts πŸ“
  • -C β€” generate range checking code. safety first, always πŸ›Ÿ
  • -L β€” generate #line directive for better C compiler messages. so when the compiler yells, it yells accurately 😭
  • -p <prefix> β€” prefix user-defined symbols by <prefix> to avoid conflict. no fighting in the group chat, periodt 🚫
  • -s <suffix> β€” add suffix <suffix> to GP install names of functions. a lil extra on the end, we love accessories πŸ’…
  • -S β€” assume strict declarations for functions. strict but fair πŸ‘‘

πŸ¦‹ query options:

  • -h β€” this help. hi bestie, you're welcome 🫢
  • -f β€” dump information about functions to stderr. spill the tea, but to stderr specifically β˜•
  • -l β€” output the list of functions known to the compiler. the full roster, no gatekeeping 🌈
  • -t β€” output the table of types known to the compiler. every type, accounted for ✨
  • -v β€” output version information and exit. quick lil fact check, then she's out the door πŸ‘‹

πŸ”₯ debugging options:

  • -d β€” increase debugging level. turn the drama up πŸ“ˆ
  • -y β€” switch parser to debug mode. the parser is now in its detective era πŸ•΅οΈβ€β™€οΈ
  • -T β€” output syntactic tree in treetool format. look at the tree bestie, it's giving arboreal 🌳
  • -TT β€” output syntactic tree in VCG/GRL format. double T, double tree, we love a sequel 🌲🌲
  • -G β€” generate GP code in place of C code. don't smile. 😐 (okay that's what it says, i'm just the messenger 😭)
  • -V β€” do not clean up variables. chaotic, leaving the mess exactly where it is πŸ’€
  • file.gp β€” file to be processed, defaulting to stdin. the generated C code is output to stdout unless option -o is used. so: no file = read from stdin, no -o = write to stdout, simple as πŸŽ€
also!! see the script gp2c-run for an automated compilation process. she does the whole thing for you, no cap πŸ‘‘

πŸ’œ COPYING πŸ’œ

Copyright 2000-2018 The PARI Group

GP2C is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. there is absolutely no warranty for GP2C. like, none. zero. not a crumb 😭


πŸ‘‘ AUTHOR πŸ‘‘

Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>


🌈 SEE ALSO 🌈

gp2c-run(1), gp2c-dbg(1), gp(1), gcc(1)


aaaand that's the whole page bestie!! this one's from the GP to C compiler crew, PARI, dated January 2005 β€” yeah she's vintage, and vintage is iconic πŸ’–βœ¨πŸ¦‹