HNHacker News
TopNewBestAskShowJobs

dtamhk

130 karma · joined November 5, 2013

submissionscomments
dtamhk··on Comparison of Haskell and Julia List Comprehensions
alternatives:

  do .² for 1…5

  (1…5)»²
dtamhk··on Ten Years at Google
This?

https://www.parallax.com/downloads/s2-gui-software

dtamhk··on Interview with Larry Wall
>Why isn't PERL more windows friendly?

That he probably didn't google hard enough.

On top of StrawberryPerl, there is also BerryPerl which is perlbrew for Windows.

http://blogs.perl.org/users/steve_bertrand/2016/07/berrybrew...

dtamhk··on Program your next server in Go
What I mean was that M$ have competing offer to Android/iOS but it is not getting the upper hand even within their own organization.
dtamhk··on Program your next server in Go
Hum .Net is their own dog food .. did you mean Android/iOS? :-D
dtamhk··on Program your next server in Go
>> given the weight of C++ and Java there.

Python as well.

>> how little Google seems to care about the language and ecosystem

Let's compare with Microsoft. The top four out of five users at StackOverFlow have top tags in C#, I guess Google have a long way to Go.

dtamhk··on Ask HN: What's the best tool you used to use that doesn't exist anymore?
HP 11C, light saber of our time.
dtamhk··on Ask HN: What's the best tool you used to use that doesn't exist anymore?
SideKick!
dtamhk··on Show HN: BitKeeper – Enterprise-ready version control, now open-source
>> Evan later wrote a paper basically saying that was an awful idea

Is this paper available online? Thanks.

dtamhk··on Perl Regular Expression Matching Is NP-Hard
Actually at the 4th Ed. of the Camel Book, there is a page or two devoted to rsc's engine

CHAPTER 5 Pattern Matching

Fancy Patterns - Alternate Engines

Starting with v5.10, you can even swap out Perl’s entire regex engine and replace it with an alternate pattern-matching library.

...

Table 5-18. Alternate regex engines

re::engine::RE2 - Russ Cox’s RE2 regex engine

...

One engine of special note is Russ Cox’s RE2 library. It’s a C and C++ library that’s used in the Go programming language, among many other places. The interesting thing is that it maintains a high level Perl compatibility, including good UTF-8 support, while avoiding the potential pitfalls of catastrophic backtracking. It does this because unlike Perl, whose engine is a recursive backtracker, RE2 uses a hybrid NFA/DFA approach that never gets bogged down in pathological cases.

This can be critical in time-sensitive applications where you want to let users provide their own pattern, but you cannot risk letting their search take forever. First written for Google’s Code Search, where time is of the essence, RE2 is also used via its Perl interface at http://grep.cpan.me. This site lets you enter a search pattern that runs over everything in CPAN.

...

dtamhk··on Ask HN: What are some of the best written programming books?
Higher-Order Perl http://hop.perl.plover.com/
dtamhk··on Why I like Java
Oh Java is the Kingdom of Nouns. :-D

http://steve-yegge.blogspot.hk/2006/03/execution-in-kingdom-...

dtamhk··on An interesting performance difference between perl and awk
About the second case, it was likely due to time spent on matching unicode digits, as per the reasoning for this stackoverflow post,

http://stackoverflow.com/questions/16621738/d-is-less-effici...

dtamhk··on An interesting performance difference between perl and awk
From the split man page

http://perldoc.perl.org/functions/split.html

=====

In time-critical applications, it is worthwhile to avoid splitting into more fields than necessary. Thus, when assigning to a list, if LIMIT is omitted (or zero), then LIMIT is treated as though it were one larger than the number of variables in the list; for the following, LIMIT is implicitly 3:

($login, $passwd) = split(/:/);

=====

and by using the a2p converter,

$ a2p <<< '{ SUM+=$5 } END {printf "%d\n", SUM}'

#!/usr/bin/perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if $running_under_some_shell; # this emulates #! processing on NIH machines. # (remove #! line above if indigestible)

eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift; # process any FOO=bar switches

while (<>) { ($Fld1,$Fld2,$Fld3,$Fld4,$Fld5) = split(' ', $_, -1); $SUM += $Fld5; }

printf "%d\n", $SUM;

So this behavior is confirmed.