I’ve finally conquered my problems with Git, so you have code to look at. In addition, I’ve added the ability to read airfoil coordinates from .DAT files such as those available from the UIUC Applied Aerodynamics Group at the University of Illinois.
Reminder: This blog is written in Racket’s "Scribble" language, and all paths are relative to ./SlowFlight/Blog.
Writing this code reacquainted me with regular expressions, and reminded me of my infatuation with Larry Wall’s PERL in the early ’90s. PERL and Racket share the power of regular expressions, of memory management, and a history of accumulating more and more powerful libraries over time, but their philosophies are worlds apart.
> (require "../airfoils.rkt" "../Private/plots.rkt") > (define-values (zs comment) (read-dat-file "../Dat/e205.dat")) > (display comment) E205 (10.48%) > (display zs) #(1.0+0.0i 0.99655+0.00039i 0.98649+0.00174i 0.97049+0.00427i 0.94916+0.00778i 0.92285+0.01196i 0.89175+0.01668i 0.85624+0.02199i 0.81684+0.02786i 0.77412+0.03419i 0.72866+0.04088i 0.68108+0.04777i 0.63204+0.0547i 0.58218+0.06147i 0.53217+0.06782i 0.48265+0.07342i 0.4341+0.07785i 0.3868+0.08081i 0.34101+0.08214i 0.29699+0.08177i 0.25496+0.0797i 0.21508+0.07606i 0.17764+0.07111i 0.14302+0.06507i 0.11157+0.05811i 0.0836+0.0504i 0.05937+0.04211i 0.03909+0.03344i 0.02292+0.02461i 0.01097+0.01589i 0.00331+0.00766i 2e-005+0.00055i 0.00233-0.00506i 0.01065-0.00988i 0.02419-0.0142i 0.04291-0.01776i 0.06669-0.02053i 0.09534-0.02252i 0.12864-0.02378i 0.16627-0.02436i 0.20783-0.02435i 0.2529-0.02384i 0.30097-0.02292i 0.35149-0.02168i 0.40388-0.02021i 0.45751-0.01859i 0.51174-0.01689i 0.56591-0.01516i 0.61938-0.01345i 0.67149-0.0118i 0.7216-0.01023i 0.76911-0.00876i 0.81343-0.0074i 0.854-0.00614i 0.89034-0.00497i 0.92195-0.0038i 0.9486-0.00252i 0.97017-0.00125i 0.98635-0.00036i 0.99651-3e-005i 1.0+0.0i) > (plot-foil zs) (object:2d-plot-snip% ...)
Larry’s hope, like the creators of FORTRAN and COBOL and to some extent, C, was to make computer code more readable to the user, to humans.
This demonstates a fundamental misunderstanding of human nature, and of the needs of computer programmers.
Most people are readers, not writers. Most people are users, not programmers. Users don’t need or want to write computer programs. Programming languages, therefore, ought not to cater to users.
Therefore, computer languages should be aimed at only a subset of humanity, at those who understand computers’ need for ordered input.
This is PERL’s, and C’s, and FORTRAN’s error – they attempt to cater to too many humans, they attempt to accomodate their wide ranges of expression, of saying the same thing in many ways, and they all fail due to man’s superior ability to obfuscate his true thoughts.
A computer programmer, however, understands the computer’s need for structure, and the LISP family’s use of parentheses for structure is no more burdensome than FORTRAN’s spacing or C’s & PERL’s brackets, braces, colons & semicolons (really? you complain about parentheses?).
Anyway, this is just a distraction from the fact that my pressure integration code is being stubborn. This much of the post (minus the Larry Wall rant) was done in November, but the lift and moment calculations I promised in my last post are taking longer than anticipated.
No comments:
Post a Comment