A
Andrew Dalke
dalkescientific.com · Personal blog · on HN since 2008
Andrew Dalke, a computational chemistry and cheminformatics developer, writes about Python, popcount optimization, language tooling, and software practices such as TDD.
What HN saysHN links his work on Python, NumPy, and cheminformatics, and commenters debate his TDD argument and praise his body of work.
25HN people shared it
13linked it in comments
15stories submitted
246story points
5 months agolast shared
2008people per year2026
Most-shared posts
- 1Problems with TDD5 people · 80 points · first shared 2009 · 64 comments on HN
- 2Python4ply tutorial3 people · first shared 2009
- 3Faster popcount update3 people · first shared 2013
- 4Hakmem and other popcounts3 people · first shared 2013
- 5LOLPython2 people · 33 points · first shared 2009 · 17 comments on HN
- 6100,000 taskelets. Python Vs Go2 people · 4 points · first shared 2009 · 1 comments on HN
- 7Bitslice and popcount2 people · first shared 2013
- 8100,000 tasklets: Stackless and Go1 people · 67 points · first shared 2009 · 21 comments on HN
- 9I parallelize an algorithm1 people · 45 points · first shared 2012 · 17 comments on HN
- 10Weininger's Realization1 people · 4 points · first shared 2016 · discussion on HN
- 11Python's concurrent.futures1 people · 3 points · first shared 2012 · discussion on HN
- 12Testing hard algorithms1 people · 2 points · first shared 2012 · discussion on HN
- 13Python4ply (a Python parser for Python) tutorial, part 11 people · 2 points · first shared 2008 · discussion on HN
- 14In search of an inverted index library1 people · 2 points · first shared 2012 · discussion on HN
- 15Threads1 people · 1 points · first shared 2008 · discussion on HN
What HN people wrote when they linked it
mhenders · 2020-01-22
http://www.dalkescientific.com/company.html
Boy, what a body of work. Would love to hear your take on Seq if you get a chance to dig in more. I come from more of a Python background and really like what I see:
- Python syntax for the most part
- Mypy style type annotations
- |> for pipelining and ||> to parallelize
- match constructs (ML-ish with guards)
- s'ACGT' and k'ACGT' for sequences and k-mers
It's relatively early in the project but I think the choices they have made give them a chance to continue to build momentum.
dalke · 2016-08-24
The best I can offer are my previous HN comments on the topic, at https://hn.algolia.com/?query=dalke%20numpy&sort=byPopularity&… and http://www.dalkescientific.com/writings/diary/archive/2011/11/09/f2pyp… .
I don't see what's awesome or all that interesting about it.
bayareaguy · 2008-12-19
I would recommend taking a quick look at how SCons and Conary use python. You may also want to consider implementing your DSL using a python parser generator such as Ply.
SCons - http://www.scons.org/doc/HTML/scons-man.html#lbBB
Conary - http://wiki.rpath.com/wiki/Conary:Recipe_Structure
Ply - http://www.dalkescientific.com/writings/NBN/parsing_with_ply.html
gpcr1949 · 2022-10-02
(I have a background in organic chemistry as well)
I somewhat disagree with this. Measuring chemical similarity is notoriously difficult, see these two interesting blog posts from a cheminformatic angle [0][1]. The molecules are not only pharmacologically similar but even chemically at least somewhat similar, perhaps in the same way a dog has much more similarities with a flying squirrel than with, let's say a church. I would argue the main active molecule [2] is relatively similar to LSD (compared to other well known psychedelics) due the presence of the tetrahydropyridine unit, which is also present in LSD, albeit connected to the 3 position of the indole in a different way. Also, there is a pharmaco*phor*ic similarity: positively charged N and 5-6 fused aromatic ring oriented in the same way with some degree of rigidity (though you could argue this is just a roundabout way to bin it in a category of 5ht2a binders). So in this way, I feel that it has something like an LSD-based design philosophy to it.
Quantitatively, making use of one of the most common similarity metrics, the Tanimoto similarity of ECFP4 fingerprints, the similarities to LSD, psilocin, DMT and mescaline are respectively 0.17,0.15,0.18 and 0.07. In other words, the similarity is low to all compounds and the indole derivatives are about equally far removed from the compound from TFA, although a bit closer than mescaline. The numbers probably rather follow your line of reasoning.
Finally, I'd also like…
plinkplonk · 2013-03-06
I'm surprised at how much attention this bit of process dogma is getting on HN.
This particular argument about the supposed efficacy of TDD depends on people accepting the equivalence of the efficiacy of TDD with the efficiacy of surgeons washing hands, just because the blog author says so.
Oh horror, how can you challenge my dogma just because I call it a 'discipline' and verbally equate it to surgeons washing hands.
Saying something is true doesn't prove it is true whether you call something a 'discipline' or not. Cults are full of such 'disciplines'. Cult members will vouch for them. A better word is 'ritual'. At best such rituals are cargo cult practices. [1]
Surgeons washing hands is a practice with empirical, unchallengeable scientific evidence supporting it,while TDD is a dogmatic practice evangelized by software process zealots, with next to no scientific evidence backing it up.
Also TDD != testing and TDD != automated testing (though the evangelizers tend to blur the differences. It is easier to argue that you should write tests, than that you should write tests before you write the code, which is a somewhat more shaky assertion. If you can paint your opponents as opposing tests (vs TDD) you have set up an easily knocked down strawman).
Programmers have written tests, including automated regression tests for decades without the blind adherence to the 'write a test first, write the code, refactor, repeat' cycle that TDD consists of.
Insisting on this as some…
jmillikin · 2009-11-23
In (path ChecksumIterator) Iter() you see something which is hard to explain verbally. Essentially, it provides a generator façade for what is underneath the surface a bucket being filled by four threads ("goroutines") concurrently. Unless things have changed markedly, it would be very difficult in Python to create a generator which produces its values with the help of some number of threads.
This is actually very easy in Python -- use a Queue[1], spawn some threads to populate it, and read from it in a generator.
Go seems interesting, but many/most of its praised features are already done better in other languages. For example, while it supports "thousands of goroutines" (green threads), Haskell supports millions of green threads[2]. Even Stackless, which is not known for performance, has faster gthreads[3].
Go also perpetuates several mistakes from C (ugly brace-delimited syntax) while dropping the true genuinely useful features (pointer arithmetic, manual memory management). Considering the wealth of high-quality, high-performance languages with mature library and compiler support (Haskell, Erlang, Factor, OCaml, even Ada), I'm mystified as to why Google would invest the time and energy into promoting yet another C clone.
I suppose in a year, Go will be another mostly-abandoned language with a few users poking around the mailing list asking "what happened?". Most News.YC readers can name at least one language released to great fanfare, but with little developer…
eesmith · 2022-06-06
Here' an ancient hack that showed how that might look like - http://dalkescientific.com/Python/python4ply-tutorial.html#matching .
count = 0
t1 = time.time()
for line in open("nucleosome.pdb"):
if line =~ m/(ATOM |HETATM)/:
count += 1
print count, "atoms in", time.time()-t1, "seconds"
It used it own PLY-based parser to generate the Python AST.
None of it would work now. :)
4gotunameagain · 2021-06-14
That's interesting, thanks.
It seems that look up tables are still faster when memory allows it though (http://www.dalkescientific.com/writings/diary/archive/2008/07/03/hakme…
lqdc13 · 2016-03-13
popcnt is used very frequently IMO.
One example is Bloom filter which is used extensively in many domains.
Another example is Tanimoto distance that has to be super fast for computational chemistry
http://www.dalkescientific.com/writings/diary/archive/2011/11/02/faste…
_ihaque · 2013-07-30
Along the same vein, Andrew Dalke wrote up an interesting series of blog posts benchmarking different implementations of population count (counting the number of set bits in a word):
http://dalkescientific.com/writings/diary/archive/2008/07/03/hakmem_an…
http://dalkescientific.com/writings/diary/archive/2008/07/05/bitslice_…
http://dalkescientific.com/writings/diary/archive/2011/11/02/faster_po…
The Stanford Bit Hacks page linked in the original article is also very interesting reading for folks into this sort of stuff.
anon1385 · 2013-03-16
http://www.dalkescientific.com/writings/diary/archive/2009/12/29/probl… is a much better article about the problems with TDD.
ubernostrum · 2009-06-13
It's been done, by Andrew Dalke, using a Python extension toolkit he developed:
http://dalkescientific.com/Python/python4ply-tutorial.html#pattern
He presented it at PyCon a couple years ago, response seemed to be "that's cool".
diwank · 2012-01-16
tl;dr -
I think I fixed this problem in my app (iheartpy.com) using AIML. Caution: Still a work in progress.
The whoe thing -
I am a self-taught programmer. And I had been an extensive user of codeacademy myself. I realized this rather serious design flaw early on and tried to do something about it.
Initially, I tried to right my own engine based on JSON but midway I discovered AIML. It suited the task perfectly. So I downloaded pyAIML library [1]. It is surprisingly simple to get started with. I hacked around a bit and got a workable python app.
Finally using pyAIML + regexp, I ended up with a crude engine that takes something like this (in Python):
def foo(param1, param2)
and spits out:
FUNCTION foo PARAMS param1 param2
which can be easily manipulated and replied to by the pyAIML parser. It worked flawlessly. And moreover, designing lessons is as simple as creating an XML file.
Then I threw together a minimal UI and got it up and running on App Engine here:
iheartpy.com
I used CodeMirror [2] for the editor. The focus of the UI was to be extremely minimal ( = blazing fast) and delightfully non-distracting ( = no post-to-facebook rubbish). This being a side-project, I thought I could easily get away with that. :)
Honestly, this is my first project and looks more like the work of a script-junkie at this point of time. The lessons are not done yet. I wasted a lot of time in trying to optimize my app for App Engine. And now I'm an 18 year-old who…