NNTP-Posting-Date: Fri, 25 Jul 2014 07:27:07 -0500 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: <38c5efcc-315c-4b8d-a478-89e352af7143@googlegroups.com> Subject: Re: Java blunders Date: Fri, 25 Jul 2014 13:22:49 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 50 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-mFs2slkhixQ4ytzZdTzt5/IzVuQFNyGSIwBWVw7hh5m6OyM3JmSgNC5NBGnJZJMkFuK56tmTR95MDs0!cabIggvQg1YIzmMwDRxXh0qgI5nUl+xP6APcttC6ZyE0fBGpDu5uKazHzVd0Xp2tC5j37k/X5g== X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 4007 Path: csiph.com!usenet.pasdenom.info!news.stben.net!border3.nntp.ams.giganews.com!backlog3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail Xref: csiph.com comp.lang.java.programmer:29304 taqmcg@gmail.com wrote: > The bit that confuses me -- and I agree that Java is not the only place > this happens -- is that everyone agrees that I/O is complex and > difficult. And the first decision that seems to be made about it is that > given this complex, difficult but critical element that all of our > programs need, lets ensure that the only syntax that is available to > address it is a method/function. Maybe some of the complexity could be > addressed more cleanly if we thought about I/O as fundamental element of > what we are doing through the language design process rather than > something to be bolted on as library (or libraries) at the end. I'd like to turn this around and suggest that the problem is not that language designers "bolt-on" IO after the fact, but that the languages aren't expressive enough for that not to be a problem. Personally I think (and it's a pretty widely shared view ASAICT) that it's a /good/ thing if IO is expressed as library code /written in/ the language rather than being hardwired into the language design. However, if the language can't directly express IO in some transparent way, then that's an indication that the language itself is not expressive enough, and that -- presumably -- other libraries (including different approaches to IO) will also suffer from the same lack of expressiveness. Java is -- of the mainstream or semi-mainstream languages I know even a little about -- the least expressive[*]. That may improve as more "stuff" gets hacked into the language design, but there's little sign of it yet. But, OTOH... > To illustrate this (and I'm designing this as I write it, trying to > illustrate how we could integrate I/O within the language differently > that we do now). suppose that we had the idea that all variables (both > primitives and objects) in Java were emitters and receivers -- a basic > property for all things. If you don't already know Icon (dead as a language, AFAICT, but very much alive as a /design/ for a language) you might find that interesting. In Icon all value-producers conceptually produce a /stream/ of values, which gives it a unique(-sh[**]) flavour for several not-obviously-connected problems from IO to search. It's not quite the same as your proposal, but anyone who (like me) finds virtue in yours should find Icon interesting too. -- chris [*] Fortran and Cobol are also contenders for the title, I assume, but I don't know anything like enough about their modern incarnations to be sure. [**] Not so unique for Prolog users, but Icon is a traditional imperative language.