{"id":22160912,"url":"https://github.com/themanyone/itcc","last_synced_at":"2025-07-26T09:31:53.034Z","repository":{"id":222563848,"uuid":"626119453","full_name":"themanyone/itcc","owner":"themanyone","description":"A RAD new way to program: simple, light-weight read-eval-print loop (REPL)s for C, C++, Rust, Hare, Zig, Go, and Crap...","archived":false,"fork":false,"pushed_at":"2024-08-08T05:41:02.000Z","size":379,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-08T07:04:58.392Z","etag":null,"topics":["contest","go","golang","hare","interactive","programming","python","rad","repl","rust","zig"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/themanyone.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-10T20:52:18.000Z","updated_at":"2024-08-08T05:41:05.000Z","dependencies_parsed_at":"2024-03-12T02:31:10.372Z","dependency_job_id":"90fa0a22-0666-4945-a914-63ac74bb5402","html_url":"https://github.com/themanyone/itcc","commit_stats":null,"previous_names":["themanyone/itcc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themanyone%2Fitcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themanyone%2Fitcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themanyone%2Fitcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/themanyone%2Fitcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/themanyone","download_url":"https://codeload.github.com/themanyone/itcc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227668719,"owners_count":17801513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["contest","go","golang","hare","interactive","programming","python","rad","repl","rust","zig"],"created_at":"2024-12-02T04:11:15.349Z","updated_at":"2024-12-02T04:11:16.200Z","avatar_url":"https://github.com/themanyone.png","language":"Python","readme":"Interactive TCC\n===============\n\nMake programming fun like Python.\n\nAn command-line shell for C, C++, Rust, Hare, Go, Zig, and the concise, regex-aware \nCPP (CRAP). Also known as an evaluation context, or read-eval-print loop (REPL), this revolutionary shell tool allows programmers to type commands in a variety of compiled\nlangauges and see immediate results.\n\nAbout this project. Interactive TCC (itcc) is a small python3 utility originally \nforked from Interactive GCC (igcc). And we keep adding other languages to it. We do \nour best to make the code work for us, but it comes with NO Warranties. You are free \nto share and modify free software in according with the GNU General Public License \n(GPL) Version 2. See the notice at the bottom of this page and COPYING.txt for \ndetails. Get ITCC from GitHub https://github.com/themanyone/itcc\n\nDependencies. Build the optional TINYCC compiler (tcc) (or skip down to the C++ section \nad use GCC). The experimental MOB branch of tcc accepts random contributions from \nanyone, so check it over carefully! Join the active mailing list, contribute fixes, \nand update often. git clone https://repo.or.cz/tinycc.git/\n\nNow with color listings. Install Colorama Highlight (required). Available through your\ndistro package manager, conda, or pip.\n\nThe main reason we like tcc is instant gratification. Owing to its small download \nsize, and the smallness of the resulting executables, tcc's one-pass build ensures \nvirtually no compiler delays between entering code and seeing the results! Tcc \nsupports Windows, Linux, Android and other targets with many common GCC extensions. \nBut it might lack some of the optimizations of GCC. Also, tcc is a C compiler, not a \nC/C++ compiler suite like GCC.\n\nUse our Interactive tcc shell, like this:\n\n $ ./itcc\n Released under GNU GPL version 2 or later, with NO WARRANTY.\n Type \".h\" for help.\n \n tcc\u003e int a = 5;\n tcc\u003e a -= 2;\n tcc\u003e if (a \u003c 4) {\n tcc\u003e    printf(\"a is %i\\n\", a);\n tcc\u003e }\n a is 3\n tcc\u003e |\n\nPass arguments to Interactive TCC and operate on them.\n\n $ ./itcc -- foo bar baz\n\n tcc\u003e puts(argv[2]);\n bar\n tcc\u003e |\n\nInteractive Crap\n================\n\nInteractive, concise, regex-aware preprocessor (icrap) *is standard C* (using tcc in \n the background), without most of the semicolons, curly braces, and parenthesis. Like \n Python, use tab or indent 4 spaces instead of adding curly braces. Use two spaces \n instead of parenthesis. Since braces are added automatically, it saves typing. There \n are also some exciting, new go-like language features that really simplify C coding. \n Get crap from https://themanyone.github.io/crap/ Released under GNU GPL \n version 2 or later, with NO WARRANTY. Type \".h\" for help.\n\n $./icrap -lm\n crap\u003e #include \"math.h\"\n crap\u003e for  int x=0;x\u003c5;x++\n crap\u003e      printf  \"%i squared is %0.0f\\n\", x, pow(x, 2.0)\n 0 squared is 0\n 1 squared is 1\n 2 squared is 4\n 3 squared is 9\n 4 squared is 16\n crap\u003e |\n\nSupply includes and libs on the command line. You can link against glib-2.0, plugins, \netc. Test code without the compile step. Add extra CFLAGS and args. It's all free.\n\n icrap $(pkg-config --cflags --libs glib-2.0) -std=c11 -g -Wall -- foo myargs\n crap\u003e .l\n #include \u003cglib.h\u003e\n #include \u003cglib/gprintf.h\u003e\n crap\u003e GDateTime *dt=g_date_time_new_now_local ();\n crap\u003e int yyyy,mm,dd\n crap\u003e g_date_time_get_ymd dt, \u0026yyyy, \u0026mm, \u0026dd\n crap\u003e g_print \"date: %.4d-%.2d-%.2d\\n\", yyyy, mm, dd\n date: 2024-02-14\n crap\u003e puts  argv[2]\n myargs\n crap\u003e |\n\nInteractive Tcc and Interactive Crap build upon the original Interactive GCC (igcc), \nwhich is also included in this package. Those who have no problem converting C++ to C, \nmight even be able to struggle through some of following examples using itcc, or \nicrap.\n\nInteractive GCC\n===============\n\nUse Interactive GCC for C++ programming, like this:\n\n $ ./igcc \n g++\u003e int a = 5;\n g++\u003e a += 2;\n g++\u003e cout \u003c\u003c a \u003c\u003c endl;\n 7\n g++\u003e --a;\n g++\u003e cout \u003c\u003c a \u003c\u003c endl;\n 6\n g++\u003e |\n\nIt is possible to include header files you need like this:\n\n $ ./igcc \n g++\u003e #include \u003cvector\u003e\n g++\u003e vector\u003cint\u003e myvec;\n g++\u003e myvec.push_back( 17 );\n g++\u003e printf( \"%d\\n\", myvec.size() );\n 1\n g++\u003e myvec.push_back( 21 );\n g++\u003e printf( \"%d\\n\", myvec.size() );\n 2\n g++\u003e |\n\nStart igcc with the -e option to see every compiler error notification, even a missing \nclosing brace from an unfinished block of code. These types of error notices are not \nuseful for interactive sessions, so we hide them. You can always use .e to check for \nerrors even without such warnings.\n\n $ ./igcc -e\n g++\u003e #include \u003cmap\u003e\n g++\u003e map\u003cstring,int\u003e hits;\n g++\u003e hits[\"foo\"] = 12;\n g++\u003e hits[\"bar\"] = 15;\n g++\u003e for( map\u003cstring,int\u003e::iterator it = hits.begin(); it != hits.end(); ++it )\n g++\u003e {\n [Compile error - type .e to see it.]\n g++\u003e\tcout \u003c\u003c it-\u003efirst \u003c\u003c \" \" \u003c\u003c it-\u003esecond \u003c\u003c endl;\n [Compile error - type .e to see it.]\n g++\u003e }\n bar 15\n foo 12\n g++\u003e |\n\nExtra include directories can be supplied:\n\n $ ./igcc -Itest/cpp -Itest/cpp2\n g++\u003e #include \"hello.h\"\n g++\u003e hello();\n Hello, \n g++\u003e #include \"world.h\"\n g++\u003e world();\n world!\n g++\u003e |\n\nLibs can be linked:\n\n $ ./igcc -lm # bad example since libm.a is already linked in C++\n g++\u003e #include \"math.h\"\n g++\u003e cout \u003c\u003c pow( 3, 3 ) \u003c\u003c endl;\n 27\n g++\u003e |\n\nYour own libs can be linked too:\n\n $ ./igcc -Itest/cpp -Ltest/cpp -lmylib\n g++\u003e #include \"mylib.h\"\n g++\u003e defined_in_cpp();\n defined_in_cpp saying hello.\n g++\u003e |\n\nThe cstdio, iostream and string headers are automatically included, and the std \nnamespace is already in scope.\n\nInteractive Rust\n================\n\nWe can now run rust interactively. Get rustup from http://rust-lang.org or your \ndistro's package manager. Use the nightly build for cutting-edge development.\n\nrustup toolchain install nightly\nrustup default nightly\n\nTyping .h [std] or any such rust idiom brings up a local copy of the documentation \nfrom https://rust-cli.github.io/book/tutorial/cli-args.html, which should be installed \nwhen you install rust using the above method.\n\nNow we can invoke irust. Arguments after the `--` are passed along to the interactive \nsession for us to play with.\n\n $ ./irust -- foo bar baz\n irust 0.3\nReleased under GNU GPL version 2 or later, with NO WARRANTY.\nType \".h\" for help.\n\n rust\u003e use std::env;\n rust\u003e let args: Vec\u003cString\u003e = env::args().collect();\n rust\u003e for arg in args.iter() {\n rust\u003e     println!(\"{}\", arg);\n rust\u003e }\n foo\n bar\n baz\n rust\u003e |\n\nInteractive Hare\n================\n\nHare is a systems programming language with a static type system, manual memory \nmanagement, and a small runtime. It's well-suited for low-level, high-performance \ntasks like operating systems, system tools, compilers, and networking software. Now \nyou can play with it interactively.\n\nHare Website:   https://git.sr.ht/~sircmpwn/harelang.org\n\nHare compiler:  git clone https://git.sr.ht/~sircmpwn/harec\nHare std libs:  git clone https://git.sr.ht/~sircmpwn/hare\nDepends on QBE: https://c9x.me/compile/code.html\nRequires scdoc: https://git.sr.ht/~sircmpwn/scdoc\n\nCompile everything from the latest sources. Once installed, it will work with our \ninteractive demo here. Also, be sure and get more help, libraries, and resources \nbelow.\n\nInteractive hare session:\n\n $./ihare\n ihare 0.3\n Released under GNU GPL version 2 or later, with NO WARRANTY.\n Get hare from https://sr.ht/~sircmpwn/hare/sources\n Type \".h\" for help.\n\n hare\u003e const greetings = [\n hare\u003e           \"Hello, world!\",\n hare\u003e           \"¡Hola Mundo!\",\n hare\u003e           \"Γειά σου Κόσμε!\",\n hare\u003e           \"Привіт, світ!\",\n hare\u003e           \"こんにちは世界！\",\n hare\u003e   ];\n hare\u003e   for (let i = 0z; i \u003c len(greetings); i += 1) {\n hare\u003e           fmt::println(greetings[i])!;\n hare\u003e };\n Hello, world!\n ¡Hola Mundo!\n Γειά σου Κόσμε!\n Привіт, світ! \n こんにちは世界！\n hare\u003e \n hare\u003e // get help on rt::timespec\n hare\u003e .h rt::timespec\n type timespec = struct {\n        tv_sec: time_t,\n        tv_nsec: i64,\n };\n hare\u003e |\n\nInteractive Zig\n===============\n\n$ izig\nizig 0.3\nReleased under GNU GPL version 2 or later, with NO WARRANTY.\nGet zig from distro package or https://ziglang.org/\nType \".h\" for help.\n\nzig\u003e const stdout = std.io.getStdOut().writer();\nzig\u003e try stdout.print(\"Hello, {s}!\\n\", .{\"world\"});\nHello, world!\nzig\u003e |\n\nInteractive Go\n==============\n\n$ igo\nigo 0.3\nReleased under GNU GPL version 2 or later, with NO WARRANTY.\nGet go from https://go.dev/                                                                   \nType \".h\" for help.                                                                           \ngo\u003e fmt.Println(\"Welcome to the playground!\")\nWelcome to the playground!\ngo\u003e import \"time\"\ngo\u003e fmt.Println(\"The time is\", time.Now())\nThe time is 2024-03-02 10:28:25\ngo\u003e .L\npackage main\nimport \"fmt\"\nimport \"time\"\nfunc main() {\n    fmt.Println(\"Welcome to the playground!\")\n    fmt.Println(\"The time is\", time.Now())\n}\n\ngo\u003e |\n\nFAQ. Issues.\n============\n\nHow does it work? Does it re-run the entire code block each time?\n\nYes. Although it runs all the code each time, it only prints the new output. \nSupposedly. There appears to be some bugs with detecting what was already printed, \ncausing some new lines to produce no output. In that case, just press CTRL-C or CTRL-D \nand restart it. We're working on that...\n\nYour Editor Is Now a REPL\n=========================\n\nOur replacement is here. Any language. Any editor.\n\nWe made a REPL maker! This command is all you need.\n $ repl.sh [compiler] -run [sources]\n\nIt watches `test.c` for changes. If it detects any, it compiles and runs.\n\nCompiler options supported. After `--` my args are available inside script.\n $ repl.sh tcc $CFLAGS $LIBS -run test.c -- my args\n\nUse `runner` if your compiler does not have a -run option.\n $ repl.sh runner gcc $CFLAGS $LIBS test.c -- my args\n\nThe `hare` build system.\n $ repl.sh runner hare build hello.ha -- my args\n\nSome new Smurf language? Smurfy.\n $ repl.sh smurf run papa.smurf -- my args\n\nGet REPL Ace free from https://github.com/themanyone/REPLace\n\nUpdating This Package\n=====================\n\nitcc is published on GitHub. Get it from https://github.com/themanyone/itcc where \ndevelopers can submit bug reports, fork, and pull requests with code contributions.\n\nOther REPLs\n-----------\nREPLAce: a REPL for all languages https://github.com/themanyone/REPLace\nvarious languages in the browser http://repl.it\ncsharp: included with monodevelop http://www.csharphelp.com/\npsysh: comes with php for php code http://php.net\nevcxr: another Rust REPL https://github.com/evcxr/evcxr\nipython: interactive python https://github.com/ipython/ipython\nrep.lua: a lua REPL https://github.com/hoelzro/lua-repl\nre.pl: perl command line https://github.com/daurnimator/rep\nd8-314: from V8, JavaScript https://developers.google.com/v8/\ncsi: from chicken, a scheme REPL http://call-cc.org/\nRStudio: interactive R coding https://rstudio.com/\nRuby IRB: REPL tool for Ruby https://ruby-doc.org/stdlib-2.7.2/libdoc/irb/rdoc/IRB.html\nnumerous bash-like shells and interpreters\n\nLegacy Code\n-----------\n\nFor Python2, you may opt to download Andy Balaam's original IGCC tarball from the \nSourceforge download area:\n\nhttps://sourceforge.net/projects/igcc/files/\n\nUntar it like so:\n\n tar -xjf igcc-0.1.tar.bz2\n\nAnd then start the program like this:\n\n cd igcc-0.1\n ./igcc\n\nLinks\n-----\n\nIGCC home page:\nhttp://www.artificialworlds.net/wiki/IGCC/IGCC\n\nIGCC Sourceforge page:\nhttp://sourceforge.net/projects/igcc/\n\nAndy Balaam's home page:\nhttp://www.artificialworlds.net\n\nAndy Balaam's blog:\nhttp://www.artificialworlds.net/blog\n\nContact\n-------\n\nAndy Balaam may be contacted on axis3x3 at users dot sourceforge dot net\n\nCopyright\n---------\n\nIGCC is Copyright (C) 2009 Andy Balaam\n\nIGCC is Free Software released under the terms of the GNU General Public License \nversion 2 or later.\n\nIGCC comes with NO WARRANTY\n\nSee the file COPYING for more information.\n\nThis fork is maintained with updated code, which is Copyright (C) 2024 by Henry Kroll \nIII under the same license. Blame him if there are problems with these updates. Issues \nfor this fork are maintained on GitHub.\n\nBrowse Themanyone\n- GitHub https://github.com/themanyone\n- YouTube https://www.youtube.com/themanyone\n- Mastodon https://mastodon.social/@themanyone\n- Linkedin https://www.linkedin.com/in/henry-kroll-iii-93860426/\n- [TheNerdShow.com](http://thenerdshow.com/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemanyone%2Fitcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthemanyone%2Fitcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthemanyone%2Fitcc/lists"}