Bloom implementation in Scala?

297 views
Skip to first unread message

Adelbert Chang

unread,
Apr 10, 2013, 8:23:57 PM4/10/13
to bloom...@googlegroups.com
Hello,

I recently came across the Bloom language and it looks really interesting - I am generally interested in modern languages that are built with concurrency/distribution in mind. Being a big fan of Scala, I was interested in seeing on the website that at some point you guys have tried to encode Bloom in it? Is there any source code for this I may look at (I understand it is probably not "complete") - perhaps with some guidance I can take a crack at it :-)

Thanks!
Regards,
-Adelbert Chang

Marvin Hansen

unread,
Apr 12, 2013, 11:01:56 AM4/12/13
to bloom...@googlegroups.com
Hi,

same here, I think the general concept of distributed consistency needs to be spread and Scala is
an excellent choice to start with.

@Adelbert: how serious are you about bringing some of blooms features to Scala?

I have a damn crazy idea ...

Adelbert Chang

unread,
Apr 12, 2013, 12:40:35 PM4/12/13
to bloom...@googlegroups.com
Bud is cool, but I'd like to see a Bloom implementation with some static typing :-) And the idea of distributed consistency is certainly interesting.

As for how serious I am, I'd like to say I'm fairly serious. Most of my background thus far has been in cluster computing, specifically graph processing, and I'm looking to explore other, broader facets of the language, and embedding Bloom I think would be very interesting. I recently picked up "DSLs in Action" and am working my way through that.

If you're interested, perhaps we can talk more about your "damn crazy idea?"

Neil Conway

unread,
Apr 12, 2013, 1:40:41 PM4/12/13
to bloom...@googlegroups.com
As far as existing Bloom prototypes in Scala, I don't think any of the
code would be very usable. At one point, we were playing with one
prototype of a successor language in Scala, but that effort isn't
currently active. Bill Marczak also has a Scala-based language that is
similar in some ways to Bloom, but that is a research project with
different goals and probably wouldn't make a good starting point for a
Bloom implementation. So I'd personally suggest starting from scratch.

But I'd love to see a Bloom implementation in Scala! I'd be happy to
help out, so please feel free to get in touch if you have any
questions -- either via email, or I'd be happy to chat on the phone.

Neil
> --
> You received this message because you are subscribed to the Google Groups
> "Bloom Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bloom-lang+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Adelbert Chang

unread,
Apr 12, 2013, 5:15:38 PM4/12/13
to bloom...@googlegroups.com
Hi Neil,

Thanks for the response - glad to have support from someone on the team for this venture :-) Is there a particular email address you prefer if I need to get in touch?

Thanks!
Regards,
-Adelbert

Marvin Hansen

unread,
Apr 12, 2013, 10:09:41 PM4/12/13
to bloom...@googlegroups.com
Okay,

For a long time, I have this dream of pursuing real-time brain simulations
As the brain is a giant network of interconnected neurons, it actually forms a graph of graphs....

To my best knowledge, the major obstacle in today's neuroscience is actually the speed of coding in order
to get experiments done. There is a research DSL's based on Python which suffers on ugly debugging
caused by dynamic typing. Other tools are written in Java but suffer on verbose (slow) coding and even
worse, they hardly scale at all. Scaling, in general, is big issue as many aren't familiar with cluster programming.  

Scala, fits in nicely as its safe, fast to code and has already solid concurrency built-in
I'm just finishing my Msc around compile-time verification of correct concurrency in Scala.
With Scala's compiler macro's, code checking and transformation works but not exactly trivial. 

When it comes to scaling out, Scala prefers actors which is fine for
commercial deployment where fault-tolerance is more important than efficiency but for
processing billions of requests, it's just hopeless. 

I've experimented with a special-form of consumer & producer interconnected with 
a circular buffer (aka Disruptor) and its actually the fastest possible local concurrency in Java 
but it can scale out in a Cluster using any messaging protocol. However, the problem is
programming this beast is pain in the ass, to say the least. 

While thinking more about how to tackle this issue, 
I've come up with the idea of a Neuro-DSL embedded in Scala that stands on three pillar's:

1) Cache optimized data-structures. 

The reason why many data structures in Java and Scala have such a terrible performance is simply the wast
amount of cache-misses they produce on CPU level. Just adding simple Struct of Arrays adds 
a ~100% speedup in execution time. Going further,  exploiting spatial as well
as temporal data locality results in near zero cache misses and close to maximum performance a CPU can deliver. 
Combined with some semi-manual memory management, (packing & unpacking data in ByteArrays) means,
Java/Scala code can run up to 40x faster compared to standard collections and thus comes very close to the speed of C/C++ code. 

The problem is, coding these structures over and over again is kinda borrowing but using custom
data-structures in a DSL's actually means cache optimized data-structures can be used by default.
Also, using the "pimp my library" pattern of implicit conversion could be used to lift some of 
the worst performers (aka List) into a cache friendly version for SIMD calculations. 


2) Built-in graph operators that scales vertical with nr. of cores and horizontal with the nr. of nodes in a cluster.  

As neurons connect with several other neurons, efficient graph processing is the key. I admit, I have only 
very little understanding of modern graph algorithms. Maybe Adelbert like to comment at this point.


3) Super fast coding. It needs to be minutes, not weeks.

That is where Bloom comes in. Coding in Scala is already a magnitude faster compared to Java
but it is pretty weak in distributing tasks efficiently, fast and correct.  Bloom
on the other hands shines in minimizing coding related to distributing tasks 
and is very strong in reasoning about correctness.  

How to combine them together, ideally while exploiting concurrency efficiently?

There is an ongoing effort at Standford's pervasive parallelism  lab for  domain-specific languages embedded in Scala
with the goal  to develop parallel software without becoming an expert in parallel programming.  One result is
an "infrastructure" to build embedded DSL's so I would suggest to try their stuff first as they already have used it to
 build two prototype DSL's in Scala. . 


Code is on Github: 

One of Standford's DSL is for efficient graph analysis: 


However, to my best knowledge, there is no DSL dedicated to Neuroscience 
that is optimized for heterogeneous concurrency, safe, scales *and* is super fast to code. 

Of course this is hard and there are many, many more questions to ask. 
I do not have all the answers  but I I would say, there is a path to go and a challenge worth going for.

marvin







--
You received this message because you are subscribed to a topic in the Google Groups "Bloom Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bloom-lang/0Sy4lz21tTs/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to bloom-lang+...@googlegroups.com.

Thomas Sant'ana

unread,
Mar 28, 2014, 10:28:19 AM3/28/14
to bloom...@googlegroups.com, adel...@gmail.com
Niel and Adelbert,

     has there been work on a scala version of Bloom. I was willing to give it a try, but if someone has worked on this, I'd rather join the effort.

Thomas

Neil Conway

unread,
Mar 28, 2014, 12:10:16 PM3/28/14
to bloom...@googlegroups.com
Hi Thomas,

Josh Rosen (CC'd) has been working on an experimental variant of Bloom
that is implemented in Scala:

https://bitbucket.org/JoshRosen/bloom-scala

Neil
> For more options, visit https://groups.google.com/d/optout.

Thomas Sant'ana

unread,
Mar 28, 2014, 1:14:54 PM3/28/14
to bloom...@googlegroups.com
On Fri, Mar 28, 2014 at 1:10 PM, Neil Conway <neil....@gmail.com> wrote:
Hi Thomas,

Josh Rosen (CC'd) has been working on an experimental variant of Bloom
that is implemented in Scala:

https://bitbucket.org/JoshRosen/bloom-scala


Thanks for the quick reply. However this repository is not accessible. I do have and account on bitbucket. 

Thomas
 
You received this message because you are subscribed to a topic in the Google Groups "Bloom Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bloom-lang/0Sy4lz21tTs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bloom-lang+...@googlegroups.com.

Tupshin Harper

unread,
May 26, 2014, 2:26:32 PM5/26/14
to bloom...@googlegroups.com
Ping.

 I am quite interested in such a scala port. If this is currently private, can it be made public?

Thanks.

-Tupshin
Reply all
Reply to author
Forward
0 new messages