5 ms·
Latch concept is probably worth exploring further. Does anyone know of a language with native variables being a FIFO pipe? I.e. x = 1 // x now contains 1
by huhtenberg 16y ago
Latch concept is probably worth exploring further. Does anyone know of a language with native variables being a FIFO pipe? I.e.
x = 1 // x now contains 1
x = 2 // x now contains 1 and 2
y = x // x now contains 2, y now contains 1
...
This sort of thing. Not as an add-on construct, but as a native part of the language.
- wmf 16y agoGo channels?
- grayrest 16y agohttp://golang.org/doc/effective_go.html#channels http://golang.org/doc/effective_go.html#channels
- lukesandberg 16y agogo channels are like that (im a little rusty but it works pretty much like this). c := make(chan int, 2); c <- 1;//c contains 1 c <- 2;// c contains 1 followed by 2 y <- c;//y=1
- nitrogen 16y agoIt looks like make(chan int, 2) creates a channel with a maximum depth of two elements. I was curious how channels work, so I looked up the relevant part of the spec (http://golang.org/doc/go_spec.html#Channel_types http://golang.org/doc/go_spec.html#Channel_types). In case anyone else was wondering, specifying the length of a channel allows it to be written and read asynchronously until the channel is full. A zero-length channel will block until both a sender and receiver access the channel.
- wnoise 16y agoNot "native variables", but any concurrency package built on CSP does this. For languages where it is more built in, consider Erlang or Occam.
- gnubardt 16y agoVHDL, a hardware description language can be used in the dataflow style and models the parallelism found in hardware.
- mansr 16y agoEasy enough with Perl arrays using push and shift.
- Vivtek 16y agoWith the added bonus that Perl makes it obvious you're talking about an array.