« first day (1824 days earlier)      last day (3127 days later) » 

1:44 AM
sub g{$"--?map{g(":"x(!!$"-$"%4)."$_@_")}(0..9,a..f):print pop;$"++}$"=ord$";g$/
got it in 80 characters
it could be shorter but I wanted it obfuscated more than I wanted it short, and without eval-like tricks. Though I'm sure real Perl pros could make it both a lot less clearer and a lot shorter.
 
@Gilles So you aren't a "real Perl pro"? :-)
 
@FaheemMitha No. Look at what they pull off on Programming Puzzles & Code Golf.
 
@Gilles Well, I'll take your word for it. And I always find Perl kind of scary, myself.
 
@FaheemMitha when it's written like this, certainly
it is possible to write clear Perl code, but hardly anybody does it
 
depends on whether they think they'll be reading it again, I suppose :)
 
1:52 AM
I don't intend to re-read that particular program until it's run to completion
 
is that a JAPH entry? I missed the beginning of the thread
 
@JeffSchaller No, it prints something different
 
ok; will have to play with it later. always enjoyed people's creativity with those -- remember one with the code formatted in the shape of a camel
 
hmmm
code challenge: write a program in the shape of a camel that prints “Just another Perl hacker”, and that by rearranging whitespace only to make it in the shape of a python, prints “Just another Python hacker”
 
2:25 AM
@Gilles How about Joey Hess? :-)
 
 
2 hours later…
cas
4:03 AM
@Gilles, i reckon most of my perl code is clearly written. i deliberately choose readability over almost every other criteria (except when performance is of utmost importance). otherwise, i know i'm going to come back in 6 months and wonder WTF i did
i just wrote a perl program for a perl newbie (never used it before, but experienced with sed and some awk) and he had no difficulty understanding it.
he had some questions in chat, about perl arrays and esp about $_ but pretty much guessed the answers anyway.
 
 
2 hours later…
6:31 AM
@terdon Hi
 
 
2 hours later…
8:25 AM
@terdon Could you please look into this.. unix.stackexchange.com/questions/234432/…
 
8:56 AM
@cas Or you could use Python instead.
 
cas
@FaheemMitha. I could. python's OK. except for the white-space thing, of course. i code in python when it seems appropriate (to fit in with an existing project, like openstack, for example)
 
@cas Yes, whitespace is a bummer.
 
cas
IMO python's a language for programmers and perl's a language for sysadmins. i'm a sysadmin.
oh, and both numpy and scipy are great. i love showing researchers how they can get their stuff done faster and easier in python than fortran.
 
@cas Well, Python is slow.
@cas I don't grasp that distinction.
 
cas
what distinction?
btw, neither numpy nor scipy are slow. for most functions where speed is important, they're py wrappers around C or Fortran code.
 
9:07 AM
8 mins ago, by cas
IMO python's a language for programmers and perl's a language for sysadmins. i'm a sysadmin.
That one.
What does a language for sysadmins mean?
 
cas
there's a huge difference between sysadmins and programmers. very different (but complementary) skills sets.
 
cas
it means used mostly by sysadmins, and/or well suited to the kinds of tasks that sysadmins need to write scripts or programs for.
i could go into more detail but a) as a sysadmin i'm likely to sound disparaging towards programmers (which was not my intent) and b) it's time to start getting ready for dialysis (i'm a part-time cyborg, need to plug in to scrub my blood every 2nd day)
 
 
4 hours later…
12:52 PM
@heemayl He probably just tried to post a question consisting of "how delete file?" and the system quality controls blocked him. That's fine, if the OP can't manage to type "delete file linux" into google, we don't really want them to be active here.
@FaheemMitha Compared to what? It's as fast as any other scripting language as far as I know.
 
1:13 PM
@terdon C/C++/Fortran/Ocaml/Some flavors of Common Lisp/Haskell/Java.
 
@FaheemMitha Well yes. You can't compare compiled languages with interpreted ones, of course they'll be slower.
 
Check out the Great Language shootout. Which should be taken with the appropriate tablespoon of salt, of course.
 
Slower to run anyway, things change if you take into account how long it takes to write the program.
 
@terdon All I was saying was that it was slow. :-)
 
Is Lisp faster than Python or Perl?
 
1:15 PM
@terdon Well, yes, it depends what you are using it for.
@terdon SBCL/CCL, yes. SBCL isn't much slower than C. And CCL is slower than SBCL on average, but still fast.
SBCL is generally considered the speed king among free CL implementations.
 
@FaheemMitha Is that compiled? I thought Lisp is interpreted.
 
@terdon SBCL and CCL are both JIT. So, yes, compiled.
 
Ah, OK, well of course it's faster.
 
You don't have to run the compiler explicitly.
 
Though you can embed C in Perl but that's cheating :)
What's JIT?
 
1:18 PM
From a usage POV, you can use SBCL/CCL very similarly to Python or Perl or any other scripting language. You can write CL scripts for them too.
@terdon Just In Time compilation.
 
Ah
 
208
Q: What does a just-in-time (JIT) compiler do?

Michiel BorkentWhat does a JIT compiler specifically do as opposed to a non-JIT compiler? Can someone give a succinct and easy to understand description?

Also used in Julia and Pypy, I believe.
Essentially, JIT is compilation on the fly. The code is compiled and then immediately run. Which is typically how you want it.
Also, of course, Wikipedia.
R somehow manages to be slower than either Python or Perl. Which should be counted as some sort of achievement.
But it doesn't even do byte compilation.
 
python can become somewhat quick if you are willing to jump through certain hoops
e.g. make sure all numerical stuff is happening within numpy, use cython where able, etc
e.g. doing math on python lists is incredibly slow compared to doing the same things with numpy ndarrays.
 
1:46 PM
@FaheemMitha Both of those are very fast actually. You just have to compare like with like. You're not used to scripting languages but comparing Perl and C in terms of speed is like saying a Ferrari is slow because a jet plane is faster.
 
 
1 hour later…
2:51 PM
@terdon No, I don't compare like with like. If I want my program to finish today, I don't care about what I'm running.
 
@FaheemMitha I do since I want ti finish writing my programs today as well :)
 
@terdon Heh.
Ok, fair enough. Depends how long they take to run, I suppose.
C++ is certainly murder to run.
 
I've had great success with combining Perl and embedded C code. I have the hardcore looping/number crunching done in C and all the regex and text parsing in Perl. Went from taking a week to run to taking a few hours.
 
@terdon Yes, I've backended Python with C++ for years, using Boost Python. Which works well, but it is still a massive pain.
 
Yes it is. In my case, largely because I don't know C well enough. However, being ab;e to pass Perl hashes to C is wonderful.
 
3:00 PM
@terdon The interface is a big nuisance. It requires constant care and feeding.
Though Boost Python is impressively reliable, considering that it is essentially unmaintained.
 
I'll learn python one of these days.
 
3:33 PM
@terdon I'd give CL a try.
 
 
2 hours later…
5:04 PM
pretty sure this is above my pay grade - but not sure how to flag it appropriately (looking at the username) - unix.stackexchange.com/a/234574/117549
just sent an 'other' contact to stackexchange, fwiw
 
5:22 PM
@JeffSchaller Thanks. Next time, just flag a post by this user and let the mods know, we'll deal with it.
 
@terdon the post itself wasn't offensive, so I wasn't sure if that flag went to the right place. Will do so in the future, though -- thanks!
 
@JeffSchaller Yes, I know, I had wondered that myself before becoming a mod. Turns out, the only way to flag users, as opposed to their posts, is to flag one of the posts and choose "other" and explain why you flagged.
 

« first day (1824 days earlier)      last day (3127 days later) »