Recent work on the HUME compiler - Functional Programming ...

errorhandleΛογισμικό & κατασκευή λογ/κού

18 Νοε 2013 (πριν από 3 χρόνια και 8 μήνες)

116 εμφανίσεις

25
th

July 2007

HWU Progress

Robert Pointon & Greg Michaelson

EmBounded Project Meeting

Islay

25
th

July 2007

Overview


Compiler


Hume problem solving environment


Hierarchical Hume


Hardware
-

robots, m32c


Related work


Future work

25
th

July 2007

Compiler


Unboxing


Basic 1+1 for simple types
-

done


Basic wire/heap copy
-

done


I/O
-

work in progress


ccall
-

not started (but will follow I/O
design)


Structured types on wires, generic
operators (show, ==), and exceptions
-

planning

25
th

July 2007

Hume IDE


25
th

July 2007

Hume IDE


Import/export of Hume programs
nearing completion


Priorities now shifted back to compiler


Require efficient Hume performance


especially for vision algorithms


to give realistic real
-
time demos


Time costing requires better code gen


Currently too generic and unbounded

25
th

July 2007

Hierarchical Hume


Idea:


A box can itself be another Hume program


Need to be able to define termination of
nested programs


Can use the existing box patterns to specify
pre/post conditions of nested program and thus
constraints on behavior!


Observation:


A box need not be a Hume program, could be
anything in any language, thus gives component
based design!

25
th

July 2007

Features


Specify termination condition for the scheduling
child boxes, thus:


Can reason about parent box without considering it’s
children


Can reason about child boxes without considering
parent box context


Namespace for functions and types


Stateless boxes means no I/O defined in
nested boxes
-

still being debated…


Unhandled exceptions propagate up hierarchy

25
th

July 2007

Example

box foo


in (i::int 32)


out (o::string, p::int 32)

match


(i)
-
> (_, i+1)
--

‘_’ means some result, so RHS is a pattern!?

boxes
--

start nesting




box bar



in (i::int 32)



out (o::string, p::int 32)


match



(x)
-
> ((x, ’
\
n’) as string, x+1);



wire bar (i) (o, p);
--

parent box name isn’t required


end;
--

finish nesting

25
th

July 2007

Status


Several papers written with Gudmund Grov


Supported in Hume front
-
end
-

parser, macro
expansion, etc


Working in Hume interpreter!


Not

supported in Hume compiler


would need work on type checker (function/type
namespace) and HAM code generation


Would require re
-
think of C code generation


Suggest delaying until any later redesign for multi
-
threading and better box scheduling… not this project…

25
th

July 2007

Hardware
-

robot


Algorithms are a bit too slow for
convincing demos


Unboxing will help


Issues with I/O


Spins rather than waits, so multiple Hume
programs tend to use up CPU power quickly


Everything via sockets


Must remember to turn off all debugging,
and allow the C compiler to optimize!

25
th

July 2007

Hardware
-

m32c


Expansion Memory


£@&%^$ tech support from companies…


Two weeks time from electronics RA and
no further forward… suggestions?


I/O and Debugging


New ModSDK board is much nicer!


LCD, extra serial ports, etc


But m32c87
-

how different from ‘85’?

25
th

July 2007

Related PhD Work


Gudmund Grov



Hume coordination layer in TLA


scheduling proof in TLA


self
-
out & Hierarchical Hume are conservative
extensions of super
-
step scheduling


TLA in Isabelle


box calculus


TFP 8 paper accepted

25
th

July 2007

Related PhD Work


Chunxu Liu



HW
-
Hume in Isabelle


correctness proofs of multi
-
box H
-
W Hume
programs from standard repertoire


writing PhD

25
th

July 2007

SEAS DTC Project


Hume WCET analysis/evaluation


object tracking algorithms in Hume &
Matlab/C++


Hume integrated in Pioneer AT
-
P3
system

25
th

July 2007

SEAS DTC Project

Java
GUI

WiFi

WiFi

Hume

Hume

Hume

Laptop

Pioneer AT
-
P3

C motor
API

C image
API

C pan/tilt
API

25
th

July 2007

Future work


complete unboxing


complete base IDE


deliverables



Robert Pointon leaves Dec 2007



SEAS DTC ends Dec 2007


25
th

July 2007

Future Work


EU FP7 EmBounded 2...


EPSRC


2007/10


sensor networks/DSP/dynamic configuration


HWU & St A with Edinburgh & Queens Uni Belfast


SEAS DTC


2008/11


compositional framework/component based
simulation


HWU & StA with Waterfall Solutions