User loginNavigation |
archivesTwo Lightweight DSLs for Rich UI ProgrammingAbstract. User interfaces are evolving beyond bitmaps to include animation and special effects that utilize powerful graphics hardware. Unfortunately, the APIs used to implement these features are often not programmer friendly and can result in verbose code that is written in multiple languages. This paper describes our experience in improving UI library usability through lightweight domain specific languages (DSL) that are limited in scope to ease the use of library features rather than whole libraries. Lightweight DSL code is evaluated without meta-programming by using a hosting language’s conventional extensibility mechanisms such as operating overloading and automatic conversions. As a result, lightweight DSLs are easy to implement while their code can easily be modularized and manipulated by host language abstractions. We demonstrate the effectiveness of our technique through two C# lightweight DSLs for expressing databinding and pixel shading in Microsoft’s WPF UI library. Full paper available here, submitted for publication. Defining a containing function on polymorphic listI am trying to define a containing function to see if a value is one of the elements within a list which is polymorphic, but failed with the following codes: contain :: a -> [a] -> Bool> contain x [] = False > contain x (y:ys) = if x == y then True else contain x ys it seems that the problem is the 'operator' == does not support a polymorphic check? Any way can solve the problem? or any alternative solution to achieve the purpose? Thanks! Raeck Functional Pearl: Type-safe pattern combinatorsFunctional Pearl: Type-safe pattern combinators, by Morten Rhiger:
This approach relies on continuation-passing style for a full encoding of pattern matching. Tullsen's First-Class Patterns relies on a monadic encoding of pattern matching to achieve abstraction over patterns. Given the relationship between CPS and monads, the two approaches likely share an underlying structure. Abstracting over patterns yields a whole new level of abstraction, which could significantly improve code reuse. The only concern is compiling these more flexible structures to the same efficient pattern matching code we get when the language natively supports patterns. Section 4.9 discusses the efficiency concerns, and suggests that partial evaluation can completely eliminate the overhead. By naasking at 2008-12-22 16:35 | Functional | Type Theory | 11 comments | other blogs | 11522 reads
|
Browse archivesActive forum topics |
Recent comments
22 weeks 2 days ago
22 weeks 2 days ago
22 weeks 2 days ago
44 weeks 3 days ago
48 weeks 5 days ago
50 weeks 3 days ago
50 weeks 3 days ago
1 year 6 days ago
1 year 5 weeks ago
1 year 5 weeks ago