There are no reviews yet. Be the first to send feedback to the community and the maintainers!
c-repl: a C read-eval-print loop. Copyright (C) 2008 Evan Martin <[email protected]> Many programming languages come with a REPL (read-eval-print loop), which allows you to type in code line by line and see what it does. This is quite useful for prototyping, experimentation, and debugging code. Other programming languages, and especially C, use a "compile-run" model, and don't provide a REPL. Let's fix that. == Dependencies - GHC 6.8 - gcc - gccxml and hexpat (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hexpat) - gdb and hgdbmi (http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hgdbmi) - readline Debian/Ubuntu users on recent releases can do something like: sudo apt-get install ghc6 gccxml libghc6-parsec-dev libghc6-mtl-dev \ libghc6-hunit-dev hexpat, hgdbmi, and readline can be fetched and installed from Hackage via the above URLs or via cabal-get, and they depend on sudo apt-get install gdb libexpat1-dev c2hs libreadline-dev If you get an error from c2hs like this: /usr/include/bits/pthreadtypes.h:99: (column 6) [FATAL] >>> Syntax error! The symbol `;' does not fit here. then you unfortunately need a newer c2hs; the one in Ubuntu Hardy is at least recent enough. == Building Almost list a normal cabal-managed app: cabal configure cabal install but with one major exception, you must also run this at the end. cabal copy Why is this extra step necessary? Read Setup.lhs and tell me what I've done wrong; I've probably spent as much time trying to figure out Cabal as I have writing the actual app. I'd love to apply a patch from someone smarter than me. == Usage Type normal lines of C code and hit enter. Trailing semicolons are optional. All variable and function declarations are implicitly global, but can be initialized as if they were locals. > int x = 3 > printf("at %p, %d\n", &x, x) at 0xb7f4a550, 3 > FILE* f = fopen("README", "r") Bring in more headers by writing #include statements. Library functions that are in scope should be tab-completable at the prompt. > #include <stdlib.h> > op<TAB> open open_memstream openat64 open64 openat > open == How it works The approach is surprisingly simple: for each line of code you enter, we compile a shared object in the background. If the compilation succeeds, the object is loaded into a child process via dlopen(). Parsing of C #includes uses gccxml. (Unfortunately, I can't figure out how to use gccxml to parse the user's input, and due to the complexity of parsing C the input parser is currently hacky and heuristic.) == Debugging c-repl currently can take one flag, "-v", which causes it to output the internal code that it's generating. Please include this output with bug reports. == Credit The original idea is due to Satoru Takabayashi (http://0xcc.net), who was responsible for a prototype implementation and advice on the original version. vim: set tw=72 :
retrowin32
windows emulatorwebtreemap
web-based treemapn2
n2 ("into"), a ninja compatible build systemweave
wasm viewerbloat
analyze code size via nm/objdump outputgo-imap
golang IMAP client librarypocket-mini
Save to Pocket (mini), a Chrome extension for https://getpocket.comjelly
jelly no puzzle in html5smash
a new kind of terminalgocairo
autogenerated full golang bindings for cairojs-min-bench
benchmarking js minifiersgit-cl
a git-command for integrating reviews on Rietveldcms
tiny content management system I use for my website, unlikely of interest to anyone elsej8t
javascript minifierhp
generate graphs from google-perftools heap profilesenvelope
python script to generate envelopeswebkit-who
webkit committers analysissfpng
straightforward minimal PNG decoderconfig
dotfiles, not interesting to anyone but melmnopuz
web-based crosswords (stagnant)maddr
simple addr2line reimplementationlines-spent
datavis of commit changesgat
git clone in haskellv8c
C bindings for V8 (abandoned)gen
golang basic lexer + lr parser generatorsclang
header into s-expressions via clangfin
financial analysisgoblizzard
golang parsers for blizzard data formatsgoodbye-lj
scripts to archive and delete livejournal postspicasync
download picasa (google+) albumsbuildbot-error
Chrome extension to add a "next error" link to Chromium buildbot outputdevhelp-index
command line (emacs) interface into devhelpproximo
Android app for public transit arrival timesmuni
SF muni arrival time server and Android appkeyring-dump
quick script to dump gnome keyringedit-locally
quick hack to edit chrome codesearch results in local emacssnapz
simple screenshooting appwhisper
playing around with OpenAI WhisperHarfBuzz-ng
Patches for the HarfBuzz rewritelytics
analytics without the ad networkroute
simple golang url routerh8
Haskell bindings for v8pony-express
chrome extension to prettify online mailing list archivesterminfo
terminfo parser for gopython-sourcemap
python module for parsing javascript source mapspjs
paren jsfocus
script to block time-wasting sites (news.yc, reddit, techmeme, etc.)chrome-textfix-ext
A Chrome extension to add a context menu item to make body text readable.onscreen
image cycler for wall displaysflatzip
create mtime-equivalent directory mirror with files filled with zerosstates
compare US states and EU countriesgit-ffwd
script to forward-port old branchescute-sideload
cute overload feed without the creepy babytalkdiff
crostini diff toolhscairo
Cabalized version of gtk2hs's Cairo bindingsevmar.github.io
github pagestjs
Just screwing around with unification, nothing interesting to see.tsparse
dump TypeScript lexical ASTevanhacks
random hacks on app enginepeek
rietveld
Mirror of Rietveld, the App Engine code review siterust-toys
toy apps to play with the rust languageHarfBuzz
Chrome-specific Harfbuzz patchesdiscord-clean
delete entries on discordmartine.github.io
github web pageschrome-readability
arc90's Readability bookmarklet as a Chrome extensionLove Open Source and this site? Check out how you can help us