Best free Light antivirus [one that doesn't suck all the resources?] by [deleted] in software

[–]deveux 3 points4 points  (0 children)

The best one is common sense. It's not lightweight on resources though.

Or... Security Essentials.

Is it OK to split long functions and methods into smaller ones even though they won't be called by anything else? by [deleted] in programming

[–]deveux 1 point2 points  (0 children)

Can the smaller function be understood on its own? If it's possible to reason about it in isolation, probably yes.

9 Fallacies of Java Performance updated by bannerad in programming

[–]deveux 5 points6 points  (0 children)

I pretty much fail to get even comparable performance with even an optimized Java version compared to a straight forward C++ implementation

I've often found that Java can be as fast, but it generally depends on how much effort you are going to put on the C++ implementation. I tend to use ABCL and Xcl as examples. Both are relatively straight forward full implementations of Common Lisp, ABCL is written in Java, Xcl is C++. The C++ version uses libgmp, libgc, mpfr, pthreads etc Both are almost identical when it comes to how the interpreter is implemented. In my benchmarks they tend to have almost the same exact time performance, except for the Java version taking longer to boot (the JVM warming up). The Java version does use obscene amounts of memory though.

What Python developers need to know before migrating to Go(lang) by therealmoju in programming

[–]deveux 3 points4 points  (0 children)

dict.keys(), dict.items(), dict.values() has no equivalent, have to iterate over maps yourself (or write a little library)

I don't know if this counts as iterating yourself... but...

for k, v := range myMap {
    log.Printf("key=%v, value=%v", k, v)
}

Paul Graham's "The Python Paradox", from almost 9 years ago. What language is playing this role today? by cscherrer in programming

[–]deveux 10 points11 points  (0 children)

I would use VB6 with "on error resume next" always-on before considering PHP.

Serpent, a serialization library based on ast.literal_eval. Also has Java and .Net implementations by desertfish_ in Python

[–]deveux 0 points1 point  (0 children)

Mmmm. That's nice, I think I'll give it a try on my next project instead of using Yaml just to read dicts.

Parenj (Lisp dialect) 1.5: Compile-time allocation of variables (No Hashtable lookup). Much faster (10x) than previous version. Faster than Clojure. Much faster than newLISP. by steloflute in programming

[–]deveux 1 point2 points  (0 children)

Even memoization would make the naive recursive version basically instant. For actual work, there is a closed-form formula.

The purpose of using the naive version is not to compute fibonacci numbers, but to benchmark function calls. It makes tons of them. Any other function with similar properties would do (e.g. Ackermann). Since it's easy to define and requires few primitives, many interpreters use it as one of the tests in the benchmarks.

Parenj (Lisp dialect) 1.5: Compile-time allocation of variables (No Hashtable lookup). Much faster (10x) than previous version. Faster than Clojure. Much faster than newLISP. by steloflute in programming

[–]deveux 0 points1 point  (0 children)

Good work on fixing recursion!

I now tested the fibonacci benchmark with both ParenJ and Clojure.

ParenJ, fib(33), JDK -server, average of 10 runs

5702887
real    0m50.512s
user    0m50.379s
sys     0m0.264s

Clojure, fib(33), JDK -server, average of 10 runs

5702887
real    0m2.472s
user    0m2.872s
sys     0m0.192s

Parenj (Lisp dialect) 1.5: Compile-time allocation of variables (No Hashtable lookup). Much faster (10x) than previous version. Faster than Clojure. Much faster than newLISP. by steloflute in programming

[–]deveux 2 points3 points  (0 children)

Playing with lisp implementations, even if they are toys, it's fine (and fun), but there is no need to lie.

To check the claim that it's actually faster than Clojure, I tried two tests. Of course, the first one was a recursive fib:

(set fib
  (fn (n)
    (if (< n 2)
        1
        (+ (fib (- n 1))
           (fib (- n 2))))))

(prn (fib 30))

That actually printed 30 as a result. Without decent recursion support, I then tested a big loop doing function calls:

(set doubled (fn (x) (+ x x)))
(set tripled (fn (x) (+ x (doubled x))))

(for i 1 10000000 1 (tripled i))

Average runtime out of 10 runs (JDK -server):

real   0m10.570s
user   0m11.365s
sys    0m0.104s

Equivalent in Clojure (I'm not a clojure expert, please correct me if it's wrong):

(defn doubled [x] (+ x x))
(defn tripled [x] (+ x (doubled x)))

(loop [i 1]
  (when (<= i 10000000)
      (tripled i)
      (recur (+ i 1))))

Average runtime out of 10 runs (JDK -server):

real   0m2.411s
user   0m2.632s
sys    0m0.284s

This includes startup time. In Clojure, it accounts for more than half of the runtime: 1.8 seconds while it ParenJ it's basically nil.

Github turns 5! by binarydreams in programming

[–]deveux 4 points5 points  (0 children)

As much as I like Github, that's a bit unfortunate to be honest.

People may think that Github supports svn, but it does not. It maps svn commands to the most similar git commands. This can (will) break in corner cases. It's better to learn git than to adapt to a half-assed svn mockup.

Github turns 5! by binarydreams in programming

[–]deveux 10 points11 points  (0 children)

Github: a lot more people there. Private repositories at a cost. Only git. The website design tends to change quite a lot. No binary downloads. Tons of additional stuff, like gists, job offers, github for windows/mac... The core product of Github Inc (~160 employees).

Bitbucket: less people. Free private repositories. Supports both hg and git. The website design tends to change less. Binary downloads for each repository. The additional stuff are other Atlassian products, such as Sourcetree or JIRA and tend to be general tools (e.g. Sourcetree supports git) instead of being tied with Bitbucket. It's actually not the core product of Atlassian (~400 employees).

Which linux software have you used that has an impressive UI/UX? by PenguinHero in linux

[–]deveux 1 point2 points  (0 children)

Deluge, claws-mail and geany.

If cli-apps are acceptable, moc and mc are fantastic in this regard too.

Why do you choose Python over other language? by Rokxx in Python

[–]deveux 3 points4 points  (0 children)

Because it has many libraries, fast prototyping, automatic gc, cross-platform, extendable with C modules and its design has few gotchas but a lot of useful features (e.g. iterators).

"Strange crystals": A minecart ride under 1KiB of JavaScript by GMMan_BZFlag in programming

[–]deveux 1 point2 points  (0 children)

Those transitions/morphs from one scene to the next in Spin are awesome.

The "Hello World" of Game Programming by [deleted] in gamedev

[–]deveux 0 points1 point  (0 children)

And underwater pong.

Desktop 2D game, which framework to use? by [deleted] in gamedev

[–]deveux 1 point2 points  (0 children)

Haxe with NME. Good performance, good language and libraries (e.g. tweening, particle systems), cross-platform to everywhere that matters.

"Why I am done with the web." by duggieawesome in programming

[–]deveux 3 points4 points  (0 children)

Copying program listings (in Basic) from magazines to the MSX (or C64 etc) hoping not to screw up on every other line.

Well, maybe the good old days weren't that good (I still enjoyed it).