npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

igcc

v0.4.0-1

Published

Interactive GCC (igcc) is a read-eval-print loop (REPL) for C/C++ programmers.

Downloads

4

Readme

Interactive GCC

Interactive GCC (igcc) is a read-eval-print loop (REPL) for C/C++ programmers.

It can be used like this:

$ ./igcc
g++> int a = 5;
g++> a += 2;
g++> cout << a << endl;
7
g++> --a;
g++> cout << a << endl;
6
g++>

It is possible to include header files you need like this:

$ ./igcc
g++> #include <vector>
g++> vector<int> myvec;
g++> myvec.push_back( 17 );
g++> printf( "%d\n", myvec.size() );
1
g++> myvec.push_back( 21 );
g++> printf( "%d\n", myvec.size() );
2
g++>

It is possible to include your own functions using '.f':

g++> .f
Functions paste mode is ON: Enter ".f" again to return to return to normal editing.

g++> int lastIndexOf(char *str, char c) {
g++>   int ind = -1;
g++>  for (int i=strlen(b)-1;i>=0;i--) {
g++>   if (b[i] == c) {
g++>     ind = i;
g++>     break;
g++>   }
g++>  }
g++>  return ind;
g++> }
g++> .f
Functions paste mode is OFF

You can use '.p' to enter "Paste" mode to enter multi line snippets :

g++> .p
Paste mode is ON: Enter ".p" again to return to return to normal editing.

g++> char c = '_';
g++> char *a = (char *)malloc(80);
g++> char b[] = "a_another_word_there_last";
g++> strcpy(a, b[lastIndexOf('_'));
g++> puts(a);
g++> .p
Paste mode is OFF

[Compile error - type .e to see it.]

Compile errors can be tolerated until the code works:

$ ./igcc
g++> #include <map>
g++> map<string,int> hits;
g++> hits["foo"] = 12;
g++> hits["bar"] = 15;
g++> for( map<string,int>::iterator it = hits.begin(); it != hits.end(); ++it )
[Compile error - type .e to see it.]
g++> {
[Compile error - type .e to see it.]
g++> 	cout << it->first << " " << it->second << endl;
[Compile error - type .e to see it.]
g++> }
bar 15
foo 12
g++>

Extra include directories can be supplied:

$ ./igcc -Itest/cpp -Itest/cpp2
g++> #include "hello.h"
g++> hello();
Hello,
g++> #include "world.h"
g++> world();
world!
g++>

Libs can be linked:

$ ./igcc -lm
g++> #include "math.h"
g++> cout << pow( 3, 3 ) << endl; // Actually a bad example since libm.a is already linked in C++
27
g++>

Your own libs can be linked too:

$ ./igcc -Itest/cpp -Ltest/cpp -lmylib
g++> #include "mylib.h"
g++> defined_in_cpp();
defined_in_cpp saying hello.
g++>

The cstdio, iostream and string headers are automatically included, and the std namespace is automatically in scope.

Copyright

Copyright (C) 2009 Andy Balaam Copyright (C) 2019 Zaoqi

IGCC is Free Software released under the terms of the GNU General Public License version 2 or later.

IGCC comes with NO WARRANTY.

See the file LICENSE for more information.