Administrator
|
(This may be a bit odd for some of us, but I wanted to pass on a novel innovation)
http://www-cs-faculty.stanford.edu/~uno/lp.html
This is likely brought about by the coffeescript docco documentation tool, but now integrated into the coffeescript compiler. I've been imbedding markdown in agentscript for docco use once the project "got real". You can see it here:
I wasn't sure initially, but now am entirely sold on the approach. For one thing it has been invaluable for discussing the project with other programmers wishing to modify the code. The literate coffeescript announcement is here, with links showing the source in various formats:
As odd as it may seem, I recommend use of similar stunts in all languages that support it. Knuth has quite a following in this area. The idea of markdown comments certainly has a lot of traction.
( Now back to our scheduled .. er.. programming! :) -- Owen
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
So sad, and so unnecessary..
https://github.com/faylang/fay/wiki http://www.haskell.org/haskellwiki/Literate_programming -------------------------------------------------------------------- mail2web - Check your email from the web at http://link.mail2web.com/mail2web ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
Haskell is a wonderful language. But it is (obviously) functional, which means no side effects. The primary purpose of a language like JavaScript is to produce side-effects that change the DOM and what is displayed by a browser. How does Fay get around that seeming incompatibility in objectives?
-- Russ Abbott _____________________________________________ Professor, Computer Science California State University, Los Angeles On Mon, Feb 25, 2013 at 12:11 PM, [hidden email] <[hidden email]> wrote: So sad, and so unnecessary.. ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by Owen Densmore
Russ wrote:
"But it is (obviously) functional, which means no side effects. The primary purpose of a language like JavaScript is to produce side-effects that change the DOM and what is displayed by a browser. How does Fay get around that seeming incompatibility in objectives?" Haskell deals with side-effects using Monads. Las Vegas is like a Monad: "What happens in Vegas, stays in Vegas." The idea is your DOM would be an opaque type that could be returned by a function, but its state is not revealed. In this way, there are no side effects outside of the global object that is returned. http://hackage.haskell.org/package/fay-dom http://www.haskell.org/haskellwiki/Monad -------------------------------------------------------------------- myhosting.com - Premium Microsoft® Windows® and Linux web and application hosting - http://link.myhosting.com/myhosting ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
That's fine, but it seems strange to promote a language because one of its features lets you work around its primary objective.
-- Russ Abbott _____________________________________________ Professor, Computer Science California State University, Los Angeles On Mon, Feb 25, 2013 at 2:44 PM, [hidden email] <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by Owen Densmore
"That's fine, but it seems strange to promote a language because one of its
features lets you work around its primary objective." Nope. Monads are a purely functional construct. A elegant generalization, Arrows, enable one to construct Unix-style pipelines, but with typed contracts. That is, imagine having a command shell that rejected as bad syntax pipelines where the data of the consumer and producer did not make sense together. Marcus -------------------------------------------------------------------- myhosting.com - Premium Microsoft® Windows® and Linux web and application hosting - http://link.myhosting.com/myhosting ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
[hidden email] wrote at 02/25/2013 02:57 PM:
> Nope. Monads are a purely functional construct. A elegant generalization, > Arrows, enable one to construct Unix-style pipelines, but with typed > contracts. That is, imagine having a command shell that rejected as bad > syntax pipelines where the data of the consumer and producer did not make > sense together. You mean I wouldn't be allowed to listen to the smooth sounds of: echo "main(t){for(t=0;;t++)putchar(t*((t>>9|t>>13)&25&t>>6));}" | gcc -xc - && ./a.out | aplay -- =><= glen e. p. ropella You gotta help me, help me to shake off ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
On 2/25/13 5:31 PM, glen wrote:
> [hidden email] wrote at 02/25/2013 02:57 PM: >> Nope. Monads are a purely functional construct. A elegant generalization, >> Arrows, enable one to construct Unix-style pipelines, but with typed >> contracts. That is, imagine having a command shell that rejected as bad >> syntax pipelines where the data of the consumer and producer did not make >> sense together. > You mean I wouldn't be allowed to listen to the smooth sounds of: > > echo "main(t){for(t=0;;t++)putchar(t*((t>>9|t>>13)&25&t>>6));}" | gcc > -xc - && ./a.out | aplay sound synthesis built using the concepts of Functional Reactive Programming. The pipeline is all in Haskell, all the way to the OpenAL output. (No cheating with an external command line program.) http://www.haskell.org/haskellwiki/Arrow http://www.cs.rit.edu/~eca7215/frp-independent-study/Survey.pdf http://www.haskell.org/haskellwiki/Yampa http://hackage.haskell.org/package/YampaSynth Here's a couple sounds. `scifi' is a whirly-gig sort of sound, and `scale' is just a set of sequential notes. {-# LANGUAGE Arrows #-} module Main where import qualified SynthBasics as Synth import qualified Data.Audio as Audio import Player.OpenAL (play) import FRP.Yampa sciFi :: SF () Audio.Sample sciFi = proc () -> do und <- arr (*0.2) <<< Synth.oscSine 3.0 -< 0 swp <- arr (+1.0) <<< integral -< -0.25 audio <- Synth.oscSine 440 -< und + swp returnA -< audio envBell :: SF (Event ()) (Synth.CV, Event ()) envBell = Synth.envGen 0 [(0.05,1),(1.5,0)] Nothing bell :: Synth.Frequency -> SF () (Audio.Sample, Event ()) bell f = proc () -> do m <- Synth.oscSine (2.33 * f) -< 0 audio <- Synth.oscSine f -< 2.0 * m (ampl, end) <- envBell -< noEvent returnA -< (audio * ampl, end) scale :: SF () (Audio.Sample, Event ()) scale = ( afterEach [ (0.0, 60), (1.0, 62), (1.0, 64), (1.0, 65), (1.0, 67), (1.0, 69), (1.0, 71), (1.0, 72)] >>> constant () &&& arr (fmap (\k -> (bell $ toFreq k) >>> arr fst)) >>> rSwitch (constant 0)) &&& after 8 () toFreq :: Int -> Double toFreq n = 440.0 * (2.0 ** (((fromIntegral n) - 69.0) / 12.0)) main :: IO () main = do let playIt = play 44100 50000 1 -- playIt (sciFi &&& after 5 ()) playIt scale return() ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by glen ropella
On 2/25/13 5:31 PM, glen wrote:
> You mean I wouldn't be allowed to listen to the smooth sounds of: echo > "main(t){for(t=0;;t++)putchar(t*((t>>9|t>>13)&25&t>>6));}" | gcc -xc - > && ./a.out | aplay I should not let this slip-by without acknowledging that this is a functional program. +1 for that! Marcus ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by Owen Densmore
Very interesting.
I have been using Docco to document a project in JavaScript, and this is an interesting enhancement. Embedding code in documentation was only half of Knuth's Web (Wow! This dates back to when the word 'web' had no other meaning in software). The part I don't see is the macro expansion that Knuth used. Is this implemented, or is the feeling that it is the wrong thing to use with modern languages? Also, does it apply markdown or multi markdown; the latter has support for math and footnotes, etc. I would guess it is configurable. Do you know if the screenshot in http://cl.ly/LxEu is of Sublime Text 2? If so, is a special package required, or are they using the CoffeeScript package? I know I could look all of this up, but I'm hoping you could save me some time. Also, the answers could be useful to others on this list. --Barry On Feb 25, 2013, at 11:03 AM, Owen Densmore <[hidden email]> wrote:
============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by Marcus G. Daniels
Marcus G. Daniels wrote at 02/25/2013 09:19 PM:
> Here's an example taken from YampaSynth, a domain-specific language for > sound synthesis built using the concepts of Functional Reactive > Programming. The pipeline is all in Haskell, all the way to the OpenAL > output. (No cheating with an external command line program.) > > http://www.haskell.org/haskellwiki/Arrow > http://www.cs.rit.edu/~eca7215/frp-independent-study/Survey.pdf > http://www.haskell.org/haskellwiki/Yampa > http://hackage.haskell.org/package/YampaSynth VERY nice! That's the coolest and most useful thing I've learned this year. Thanks. Marcus G. Daniels wrote at 02/25/2013 09:21 PM:> On 2/25/13 5:31 PM, glen wrote: >> "main(t){for(t=0;;t++)putchar(t*((t>>9|t>>13)&25&t>>6));}" | gcc -xc >> - && ./a.out | aplay > > I should not let this slip-by without acknowledging that this is a > functional program. +1 for that! I'm still ashamed I couldn't find a way to execute the a.out content to a pipe without saving it to disk. 8^( -- glen e. p. ropella, 971-255-2847, http://tempusdictum.com Fear is the main source of superstition, and one of the main sources of cruelty. To conquer fear is the beginning of wisdom. -- Bertrand Russell ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by Owen Densmore
Microsoft's take on reactive programming, LINQ-style.
(Includes a JavaScript implementation, among others..) http://rx.codeplex.com/ And Netflix's Java implementation http://techblog.netflix.com/search/label/FRP https://github.com/Netflix/RxJava -------------------------------------------------------------------- mail2web - Check your email from the web at http://link.mail2web.com/mail2web ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
In reply to this post by Barry MacKichan
Since I asked the questions on this list, and now have the answers, I might as well send them back to the list.
On Feb 26, 2013, at 9:24 AM, Barry MacKichan <[hidden email]> wrote:
The screenshot is evidently of TextMate. Ashkenas fixed up his TextMate CoffeeScript package which is trivially adapted to Sublime Text 2. ============================================================ FRIAM Applied Complexity Group listserv Meets Fridays 9a-11:30 at cafe at St. John's College to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com |
Free forum by Nabble | Edit this page |