September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On Saturday, 14 September 2013 at 17:31:32 UTC, H. S. Teoh wrote: > I'm pretty sure this is possible with a little effort. beat you to it! http://forum.dlang.org/thread/fxuwovrirseuatzeeprb@forum.dlang.org?page=17#post-jxqobgridgweioqclfqr:40forum.dlang.org > One trick my coworkers like to use sometimes (with C/C++) is to insert an infinite loop into the program at the suspected problem spot, then at runtime when it reaches 99% CPU In D, I like to just sprinkle assert(0)'s in places. It actually works pretty well - you can do a binary search of even a fairly large codebase in just a few iterations, then fix up the asserts to actually check what went wrong, and then keep them there later to form sanity checks or unit tests to catch regressions after the bug is fixed. > OTOH, even displaying callstack may not help if your code is heavy on callbacks (or in D, delegates) invoked from event loops. indeed. |
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Adam D. Ruppe | On Sat, Sep 14, 2013 at 07:34:26PM +0200, Adam D. Ruppe wrote: > On Saturday, 14 September 2013 at 12:25:44 UTC, Paolo Invernizzi wrote: > >Give me a way to writeln the callstack frames at a certain > > Challenge accepted: > > > import std.stdio; > > string getStackTrace() { > import core.runtime; > > version(Posix) { > // druntime cuts out the first few functions on the trace as they are internal > // so we'll make some dummy functions here so our actual info doesn't get cut > Throwable.TraceInfo f5() { return defaultTraceHandler(); } > Throwable.TraceInfo f4() { return f5(); } > Throwable.TraceInfo f3() { return f4(); } > Throwable.TraceInfo f2() { return f3(); } > auto stuff = f2(); > } else { > auto stuff = defaultTraceHandler(); > } > > return stuff.toString(); > } > > > void foo() { > writeln("on foo"); > bar(); > } > > void bar() { > writeln("on bar"); > omg(); > } > > void omg() { > writeln("on omg"); > > writeln(getStackTrace()); > } > > void main() { > omg(); > > writeln("\n****\n"); > foo(); > } Whoa. My hats off to you, sir!! (And yes, I did actually test this code with a few call trees of my own. It really does work! Amazing.) I'm gonna put this into my personal D library, right now! T -- Recently, our IT department hired a bug-fix engineer. He used to work for Volkswagen. |
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russel Winder | On 9/14/2013 1:28 AM, Russel Winder wrote:
> On Fri, 2013-09-13 at 21:52 -0700, Walter Bright wrote:
>> On 9/13/2013 8:48 PM, Andrei Alexandrescu wrote:
> […]
>>> For the few souls who don't yet... http://xkcd.com/378/
>
> Emacs FTW.
>
>> I've used punch cards and paper tape. But I refused to use paddle switches.
>
> So how did you get the paper tape or punch card loader in without first
> using the paddle switches? No paddle switch manipulation, no booted
> computer. :-)
The computer was back in the machine room, and the operators booted it. I wasn't allowed back there. When I programmed single board computers, I blew the boot program into eproms.
When I finally did get my own PDP-11, the few instructions needed to initiate the boot were hardwired into the CPU.
|
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
On 14 September 2013 18:11, H. S. Teoh <hsteoh@quickfur.ath.cx> wrote: > On Sat, Sep 14, 2013 at 11:35:26AM +0200, Robert Clipsham wrote: >> On Friday, 13 September 2013 at 21:00:14 UTC, H. S. Teoh wrote: >> >On Fri, Sep 13, 2013 at 01:40:02PM -0700, Andrei Alexandrescu >> >wrote: >> >Syntax highlighting hurts my eyes. I've been using vim in >> >black-on-white for more than a decade now. (Well, more accurately, >> >black on an almost fully saturated off-white, but that's irrelevant.) >> > >> > >> >T >> >> Have you taken a look at solarized? I used to find my eyes straining after a few hours with syntax highlighting until I started using it, now I can stare for days at a time without issue. >> >> http://ethanschoonover.com/solarized > [...] > > Nah, it's still too rainbow-y for me. I still prefer no syntax highlighting. > I thought Zenburn was the go to syntax highlighting scheme for those who work in low light settings. :-) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On 09/14/13 07:53, Nick Sabalausky wrote: > (And why the freak do I need to re-./configure for every single program that needs compiled? Shouldn't something in autotools already *know* my system details and not have to re-detect *everything* every single time? "Checking X...", "Checking Y...", "Is Z sane..."...? Why? Every other damn autotools-based project *already* checked those every time I compiled them! It's like opening my car door twenty thousand times to make sure "Yup...it's still a car!". If certain changes might go unnoticed then fine, give me a way to force a re-check if really needed.) This is a (system) configuration issue. The support for persistent caches is there, it just needs to be enabled. [1] But then /you/ have to deal with invalidating the cache when something changes (which, in theory, means after /every/ sw install or upgrade). artur [1] for example, using a /etc/config.site file like: ------------------------------------------------------------------------ #!/bin/bash test -z "$SKIP_CONFIG_CACHE" || return 0 if test "$cache_file" = /dev/null -o "$cache_file" = 'config.cache' ; then PFIX=`$CC -v 2>&1 | awk ' /version /{ print$1$3"-"$4 }'` SFIX=`(set | grep '^ac_.*env' | grep -v '=$' | sort ; uname -mo ) | sha1sum | cut -f1 -d' '` cache_file="/var/cache/config.cache/$PFIX-$SFIX" fi ------------------------------------------------------------------------ |
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
On 14 September 2013 18:36, H. S. Teoh <hsteoh@quickfur.ath.cx> wrote: > On Sat, Sep 14, 2013 at 01:49:43PM +0200, Namespace wrote: >> I never thought that this becomes a discussion about windows versus linux. :o > > Didn't you know? An IDE/editor religious flamewar inevitably devolves into an OS religious flamewar? Just give it another week or so to devolve further, and I'm pretty sure we'll be able to invoke Godwin's Law. :-P > Followed swiftly by the lesser known Lewis' Law. -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; |
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | Am 14.09.2013 19:30, schrieb H. S. Teoh: > On Sat, Sep 14, 2013 at 02:25:43PM +0200, Paolo Invernizzi wrote: >> On Saturday, 14 September 2013 at 07:28:33 UTC, Nick Sabalausky >> wrote: >>> >>> Any time I use a debugger I get sooo sick of having to reset and hit >>> "step" a million times (or muck around with conditional breakpoints, >>> which never seem to be intuitive - *if* they even work at all) every >>> single time I want to see (or remember) what happened *before*. But >>> with writeln - I already see the whole relevant trace at a glance, >>> and all with exactly the same tools and interfaces I'm already using. >>> >>> Writeln debugging rocks my world. >> >> Give me a way to writeln the callstack frames at a certain point, >> and I'll take that: until this, I still need a debugger for >> following the program flow. > > I'm pretty sure this is possible with a little effort. In fact, this > would be a game-changer to writeln debugging. I should take a look at > the stack unwinding code in druntime sometime and see if I can knock > something together that does this. > > One trick my coworkers like to use sometimes (with C/C++) is to insert > an infinite loop into the program at the suspected problem spot, then at > runtime when it reaches 99% CPU, kill -11 to force a segfault to > generate a stack trace (we have a stacktrace generator hooked up to the > signal handler). I've used that a couple o' times, and it's surprisingly > effective, I must say. We found that sometimes this is the only approach > that is effective, since the path to get to the problem spot may be > completely non-trivial to reach from a debugger (may involve fork()'s, > dynamically-loaded .so's, and event loops dispatches triggered by > real-time network data that would be excruciatingly slow to step through > manually in a debugger). > > Still, if there was a way to print a stacktrace *without* terminating > the program, that would be an invaluable addition to our toolset. > > >> And no, adding a writeln everywhere you call that function is not a >> solution. > [...] > > True, this is one of the weak points of writeln debugging. Though I > usually start from the top-level, so generally by the time I get to a > specific function I already know how it got there. > > OTOH, even displaying callstack may not help if your code is heavy on > callbacks (or in D, delegates) invoked from event loops. The original > context that registered the callback is long gone by the time the > function actually runs, so the callstack only goes down to the event > dispatcher, which is no help. > > > T > So much work when one could just call the debugger from running code, http://msdn.microsoft.com/en-us/library/f408b4et.aspx at least on Windows. :) -- Paulo |
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Peter Alexander | On 2013-09-14 16:42, Peter Alexander wrote: > What does TextMate do better than Sublime? (genuine question) * It shows file icons and SCM status in the side bar. * TextMate 2 has built in support for downloading new bundles. With Sublime I need to download some Python thing and run to be able to download new languages -- /Jacob Carlborg |
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Saturday, 14 September 2013 at 05:15:32 UTC, Jonathan M Davis wrote:
> On Saturday, September 14, 2013 06:56:10 Paulo Pinto wrote:
>> Am 14.09.2013 00:06, schrieb Jonathan M Davis:
>> > .... The features that an IDE has that
>> > vim doesn't typically just aren't worth it. e.g. if I'm stuck doing
>> > Windows
>> > programming, about the most that I even do with VS is use the debugger. I
>> > even build from the command line rather than open the IDE.
>> >
>> > Vim's learning curve is quite nasty, but I definitely think that it was
>> > worth it.
>> >
>> > - Jonathan M Davis
>>
>> You mean things like:
>>
>> - Semantic refactoring
>> - WYSIWYG design of user interfaces
>> - code navigation, even across binary modules (call graph, derived
>> class, overridden methods, call sites, ...)
>> - graphical representation of code relationships
>> - UML design
>> - visual XML tooling
>> - background compilation showing where there are issues
>> - background static analysis while coding
>> - code completation with documentation popups
>> - integrate source code control with task management software to track
>> code changes to project tasks
>> - map failed unit tests to code lines
>> - ...
>
> I honestly find almost all of that to be useless or nearly so. The only one
> that I'd actually be much interested in would be better code navigation
> (particularly the ability to hop to the definition of a function). And having
> poor code editing capabilities would hamper me quite a bit. So, for me, vim
> wins hands down.
>
> - Jonathan M Davis
Vim has ctags integration, 'gd' for "Go to definition", and :tag somefunction/struct/etc
When working on a big project it can be very nice to start vim with:
$ vim -t someFunction
I usually have a `tags` target in my makefile which uses Dscanner.
|
September 14, 2013 Re: [OT] Which IDE / Editor do you use? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | On Saturday, 14 September 2013 at 16:20:21 UTC, Jonathan M Davis wrote: > On Saturday, September 14, 2013 05:58:51 Nick Sabalausky wrote: >> Those exist? >> >> I've long heard stories about such things, but they seem to be like >> unicorns or mermaids or bigfoot...fantasy creatures you only ever hear >> tales "through the grapevine" about. Not so much real evidence or >> first-hand accounts. > > Lenovo and Dell certainly used to, but I don't know about right now. One > company that's definitely still doing it though is System76 (who is one of the > Linux Action Show's sponsors). _All_ of the systems that they build are built > specifically for Linux (both desktop and laptop). They don't even sell anything > with Windows on it. I always build my own desktops, but the next time that I'm > in the market for a laptop, I'll probably end up getting one from them. > > www.system76.com > > - Jonathan M Davis My work laptop: http://www.dell.com/us/business/p/xps-13-linux/pd Well made, works out of the box. I hook it up to two large external monitors and a real keyboard when I'm at my desk. |
Copyright © 1999-2021 by the D Language Foundation