Live data from Hacker News

“Did you mean?” Experience in Ruby

yukinishijima.net

181–187 of 187 posts

Re: “Did you mean?” Experience in Ruby

#181
post #71

Earlier quoted context omitted.

I have exactly this frustration as a person coming from static languages (mostly C++) to web dev. Anybody can recommend something more comfortable? I like the concept of Vaadin, but I'd prefer something non-Java.

ASP.NET maybe? C# is one of the best-designed languages suitable to server-side dev in modern popular use. Using it with VS is the most convenient and efficient IDE experience I've encountered.

I actually enjoyed WebForms ~10 years ago. But for personal SaaS projects, free/cheap hosting space seems somewhat unrepresented. And I really don't want to go Mono-way...

As for ASP.NET itself - nowadays it seems ASP.NET MVC is recommended, but I find it way too bloat.

Re: “Did you mean?” Experience in Ruby

#182
post #145
post #77

Earlier quoted context omitted.

And with Ruby, especially since you mention Smalltalk, we have a tool that is getting closer to the kind of live introspection and modification that Smalltalk is famous for: Pry [1]. Pry lets you call "binding.pry" anywhere in your program to dump you into a shell within that context, with full access to local variables etc.. And tab-completion and plenty of introspection features. I frequently find myself triggering…

In pry is it possible to return something when I exit the REPL? Like this: def do_something return binding.pry do_something_but_does_not_work end result = do_something process result It might be very convenient if I put 'return binging.pry' just before the broken code. I can interactively fix the broken code and continue run outside of current method.

If you are explicit: "return" in a Pry session will exit pry and return the value you pass to it, just as if you are in the method itself. So e.g. "return 42" would return 42 from do_something.

Re: “Did you mean?” Experience in Ruby

#183
post #159

Earlier quoted context omitted.

I use Intellij with the PyDev plugin as my IDE and Atom (with the script package) as my text editor. In general unless it's a really quick edit PyDev is MUCH better in the general IDE functions, like autocomplete, jump to definitions, visual breakpoint debugging, etc.. I love atom but Intellij is much better for serious dev/debugging sessions.

Yeah, that has also been my experience. Why Intellij instead of Liclipse?

I really REALLY dislike eclipse. In fact it would nearly always be my last choice for and ide. In my experience it's slow, buggy, bloated, and in general the features that I need work FAR better in Intellij, Visual Studio, Atom, Sublime Text 2, Emacs, or VIM. I've used pretty much all of them and I would rather go back to them than use an eclipse based project.

Re: “Did you mean?” Experience in Ruby

#184
post #119

Earlier quoted context omitted.

It is not a "trap". In "C" it is required to generate fast machine code. It's a trade-off, not a "trap".

C (note lack of quotes) and Haskell regularly trade off "Fastest language in the world" spots on shootouts. Maybe "C" (with quotes), which is obviously a different language, is faster; I doubt it.

No they don't, Haskell is anywhere from 2-6x slower at the same problems. http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...

Re: “Did you mean?” Experience in Ruby

#185
post #95
post #40

A lot of people are recommending IDE-like tooling--but in truly dynamic language (one with a "living image" with path-dependent monkey-patched behavior that can't be replicated during static analysis, like Smalltalk--or, sometimes, Ruby) there's a more idiomatic way. In a dynamic language, if you're at all unsure of what code you need to write, then you don't write it in your editor in the first place. Instead, you b…

Is it possible that when you try and recreate your image from scratch, the code you have pasted into your editor is not sufficient to recreate the image? Maybe you pasted some things in the wrong order, or maybe you redefined a function, but some data that was created using the old version of the function is still in the image. If this is possible in your programming environment, then maybe the dead code is not worth…

The creators of Smalltalk encountered the difficulties you're thinking about while they were using Smalltalk for different projects at Xerox PARC in the '70s -- and addressed them.

Simple Smalltalk implementations are in 4 parts: the Smalltalk VM, the Smalltalk image file, the sources file and the changes file.

The image contains compiled code and objects, the sources file contains source code for some of the compiled code in the image (at least the source code provided by the vendor), and the changes file contains a log of changes made using the IDE.

Re-doing the changes recorded in the changes file should be sufficient to recreate the image up-to the last change.

In the late '80s multi person configuration management systems were developed for Smalltalk, see --

http://books.google.com/books?id=odx8WIDOcyIC&lpg=PA136&ots=...

Re: “Did you mean?” Experience in Ruby

#186
post #40

A lot of people are recommending IDE-like tooling--but in truly dynamic language (one with a "living image" with path-dependent monkey-patched behavior that can't be replicated during static analysis, like Smalltalk--or, sometimes, Ruby) there's a more idiomatic way. In a dynamic language, if you're at all unsure of what code you need to write, then you don't write it in your editor in the first place. Instead, you b…

I like this approach, and I think that we're not doing it enough. Does anyone know an effective way to do this in the browser, with JavaScript?

See http://www.lively-kernel.org/

Incidentally Dan Ingalls was a member of the original Smalltalk project.

Re: “Did you mean?” Experience in Ruby

#187
post #104

Earlier quoted context omitted.

Would you mind making a little screencast demo of your workflow? (Or do you know of any?) That sounds so cool.

Sure. I'm not near my machine for a couple of days but I'll post something when I get the chance. I see your contact info is in your profile so will ping an email when done.

UPDATE: video here https://www.youtube.com/watch?v=k-mAuNY9szI

Sound quality isn't great but hopefully it demonstrates what I'm talking about.

Post reply on HN