<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>HtD C and S: They are in my head and it's the way I teach certain courses. </div><div><br></div><div>It is overall an appeal to Brooks's idea of </div><div><br></div><div> -- garage programming (truly simple, nobody can use the results) </div><div> -- application programming (garage plus all other necessary artifacts: tests, UI, docs, internal/external, deployment, maintenance) </div><div> -- component programming (which extends garage programming in a different direction: tests, API, docs, etc.) </div><div> -- systems programming (which does both) </div><div><br></div><div>I tend to think of HtDP (esp 2e) as explaining why gp isn't enough and moving on to app in the form of self-contained modules plus the beginnings of modules/interfaces and protocols. </div><div>HtDC is about designing components and interfaces. We teach it in Java but I have come to the conclusion that this is a problem. </div><div>HtDS expands this with protocols for collaborating networked programs and maintenance </div><div><br></div><div><br></div><div> </div><div><br></div><div><br></div><div><br></div><br><div><div>On Jun 21, 2013, at 2:15 PM, Nick Shelley wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">I haven't heard of HtD Components or HtD Systems before. I can't seem to find it after some quick googling (the closest I got was a draft of HtD Classes).<div><br></div><div>Can you point me to these resources? I really enjoyed HtDP.</div>
<div><br></div><div style="">Ok, after a bit more searching I found a reference to components in the intro of HtDP 2e. I didn't see any mention of systems, but I assume that neither has been written yet and one will flow into the other which will flow into the next?</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 21, 2013 at 11:35 AM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="h5"><br><div><div>On Jun 21, 2013, at 8:26 AM, John Gateley wrote:</div>
<br><blockquote type="cite">
<div text="#000000" bgcolor="#FFFFFF">
Subject for discussion:<br>
<br>
<a href="http://firstround.com/article/The-one-cost-engineers-and-product-managers-dont-consider#" target="_blank">http://firstround.com/article/The-one-cost-engineers-and-product-managers-dont-consider#</a><br>
<br>
Interesting sentence in the middle:<br>
<br>
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:16px;text-transform:none;font-size:13px;white-space:normal;font-family:sans-serif;word-spacing:0px">Consider DSLs,
abstractions and the attraction to being the one to build a
framework that gets leveraged for years.<span> </span></span><span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:left;font-style:normal;font-weight:normal;line-height:16px;text-transform:none;font-size:13px;white-space:normal;font-family:sans-serif;word-spacing:0px"><br>
<br>
</span><br>
I think Racket is a different target: education vs. engineering (is
this true?). As a software<br>
engineer, I really agree with the article. Complexity is almost
always a terrible thing,<br>
whether it is a DSL, a complex implementation of a simple interface,
or just the<br>
one additional thing requested by product management that didn't
fit. <br>
<br>
For Racket: are DSLs a source of complexity? Or would you argue that
they reduce the<br>
complexity normally introduced with DSLs?<br></div></blockquote></div><br><div><br></div></div></div><div>John, </div><div><br></div><div>this article's claim concerning abstractions and DLS is vacuously true so it's also devoid of any information. I grant the maintenance-construction cost ratio; I teach to this slogan -- starting with How to Design Programs through HtD Components and HtD Systems. It is the guiding principle. </div>
<div><br></div><div>If we wanted to turn this person's essay into a well-founded statement that helps engineers, we would first have to clarify what complexity is or what simplicity is. No, "I know it when I see" it won't work here. To clarify, I am sure that many people will say that C is a simpler language than Racket. If we follow the article's recommendation then, we should use C. But as you know, C lacks safety and memory safety and these gaps seriously impeded software development and maintenance. The lack of safety means that you never know whether the output of a C program is serious or whether it's some random bits from some place in memory interpreted as, say, an int. The lack of memory safety in particular destroys modularity. Every dyn mem handed over from one component to another must be tracked and accounted for. </div>
<div><br></div><div>Not every language that is more complex than C will reduce the cost of software construction and maintenance. To wit, C++ started out as a more complex variant of C and to this day it is 'sold' that way even though it moved away from its roots over the past 10 years. Its complexities introduce seriously deeper safety problems, which measurably impact software construction and maintenance problems. IBM believes that this cost is a factor of 3x to 5x when compared to Java, another language that is definitely more complex than C. The San Francisco project under Kathy Bohrer, a Rice grad from around your time, ran the project in C++, switched to Java, and convinced a lot of people at IBM to measure this cost. A few years later the company switched all software to Java for these reasons. This is not to say that Java is good; but it does say that they actually measured cost, compared, and went from simple and complex languages to other complex languages. If I were a senior software dev manager at a company, I would pay attention to someone who measures and compares instead of someone who writes content-free polemics that actually sound correct. </div>
<div><br></div><div>The toggles examples from the article is apt here. The lack of safety in C means that there is no isolation and every line in a system may potentially affect the behavior of every other line -- just like the toggles/switches mentioned. But now imagine, the guy had first built a box around the first two switches so that only their relevant behavior is visible -- say two states -- and then added a third one. In that case, the interactions would be fine. </div>
<div><br></div><div>LESSON 1: simplicity by itself is not an advantage in software development. </div><div><br></div><div>LESSON 2: complexity comes in many flavors, some good, some bad. </div><div><br></div><div>Now let's move on to DSLs. A DSL, like any abstraction, helps you reduce cost if it is well designed and meets your needs. If you don't have a need in existing code for an abstraction, don't build it. If you do have a need, </div>
<div> -- understand the abstraction mechanisms of your language </div><div> -- study the concrete cases of repetition, extensive verbiage to say things </div><div> -- use the abstraction mechanisms of your language to create an abstraction that removes your repetitions, extensive verbiage. </div>
<div><br></div><div>If you work in Java, you don't have good abstraction mechanisms to eliminate domain-specific verbiage from your systems. My recent reading experience with three books on industrial DSL building tools firmly convinced me that current practice can easily flip into counter-productive architecture acrobatics. If you build these DSLs, you may make the system more costly. If you work in Racket, you have great tools for building internal DSLs and you can smoothly integrate modules written in different DSLs. As I said, this thoughts apply to any abstraction mechanism, internal DSLs are just the most powerful form of abstraction. </div>
<div><br></div><div>LESSON 3: if you have bad tools, building an abstraction may increase the cost of building a system </div><div><br></div><div>LESSON 4: with good tools, you're likely to reduce the cost, but ill-trained programmers can and do mess up</div>
<div><br></div><div>Let me finally address internal complexity vs external complexity. When you construct a language like Java, you are actually building an extremely complex system. But, the Java community succeeded beyond imagination and possibly beyond justification with making their language appear well-layered, well-structured and simple. Guy Steele has stated this as "you have to make things sufficiently complex to make them appear simple" and Matthew has stated similar experiences with the design of Racket again and again. The key is that very few Java programmers experience the complexity that the Java box hides; most have to cope with the complexities of the language. Here is an example that is more straightforward. AMPL is an external DSL for writing down mathematical programs (linear, integer, binary, graphs, networks). If you are an applied math person, the only difference between AMPL programs and paper and pencil is that the former uses ASCII. (Perhaps they use unicode these days.) It is definitely at the right level and reduces the huge cost of maintaining mathematical programs in, say, Fortran, a vastly simpler language than AMPL -- as far as the internals are concerned. AMPL is after all a complex PL, with niffty parsers and abstraction capabilities for plugging in all kinds of solvers. But it neatly separates the solver from the problem statement, for example, which while internally complex, makes it externally simple. </div>
<div><br></div><div>LESSON 5: Do not confuse external and internal complexity. A proper separation may vastly decrease the cost of creating programs. </div><div><br></div><div>Very last thought on 'complexity.' All of the above assumes that the time of programmers is more costly than what it takes to run the computation. I know of cases where this is not true. In that case, you might be better off sacrificing programmers on the altar of machine time. The cases I know are extremely rare and involve expensive programmers who understand a lot of continuous mathematics and who work with computers that are extremely expensive to use. </div>
<div><br></div><div>;; --- </div><div><br></div><div>As for Racket: yes, it is good at DSLs because we had to pay attention to building languages for our original educational goals. But for the last 10 years, the focus has widened to include a lot of industrial and quasi-industrial uses. It is no longer the TI Scheme of yore. </div>
<div><br></div><div>Your milage may vary. -- Matthias</div><div><br></div><div><br></div></div><br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></body></html>