Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.056 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'bits': 0.09; 'earliest': 0.09; 'constructs': 0.16; 'from:addr:torriem': 0.16; 'from:name:michael torrie': 0.16; 'hardware.': 0.16; 'roy': 0.16; 'subroutine': 0.16; ':-)': 0.16; 'language': 0.16; 'wrote:': 0.18; 'library': 0.18; 'bit': 0.19; 'memory': 0.22; 'header:User- Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'specifically': 0.29; 'lines': 0.31; 'too.': 0.31; 'location,': 0.31; 'pascal': 0.31; 'routine': 0.31; 'device': 0.34; 'basic': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'keyword': 0.36; 'half': 0.37; 'being': 0.38; 'system,': 0.38; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'embedded': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'access,': 0.60; 'hardware': 0.61; 'address': 0.63; 'happen': 0.63; 'registers': 0.68; 'smith': 0.68; 'subject:This': 0.74; 'touch': 0.74; 'story.': 0.93 X-Virus-Scanned: amavisd-new at torriefamily.org Date: Sat, 07 Jun 2014 13:00:24 -0600 From: Michael Torrie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131118 Thunderbird/17.0.11 MIME-Version: 1.0 To: python-list@python.org Subject: Re: OT: This Swift thing References: <8738fjkc2w.fsf@dpt-info.u-strasbg.fr> <53929baf$0$29988$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402167635 news.xs4all.nl 2838 [2001:888:2000:d::a6]:34027 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72925 On 06/07/2014 12:11 PM, Roy Smith wrote: > Several language constructs in C are there specifically to diddle bits > in hardware. Bit fields were in the earliest implementations of the > language to allow you to address individual bit control and status bits > in memory-mapped device controllers. The volatile keyword is there to > deal with bits which change value on their own (as hardware status > registers do). > > And, why do you need a library routine to touch a memory location, when > you can just dereference an integer? :-) Which of course, technically, Pascal has too. But memory addressing is only half the story. You still need interrupts and ioctl access, both of which happen via assembly instructions that libc exposes via a standard C subroutine interface. Really any language can access hardware this way. Whether it's MicroPython on an embedded system, or BASIC on a pic. The lines are being blurred.