Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
A couple of questions (Strings, OO, Server, Compilation)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ben  
View profile  
 More options Aug 30 2012, 9:57 am
From: Ben <b...@mailworks.org>
Date: Thu, 30 Aug 2012 15:54:55 +0200
Local: Thurs, Aug 30 2012 9:54 am
Subject: A couple of questions (Strings, OO, Server, Compilation)
hi

I'm exploring Elixir and also Erlang. My target is to use it for a small
web application. Since there is a lot to learn when it comes to Erlangs
concurrent facilities, my intention was to start using Elixir like a
arbitrary general purpose language and the approaching the concurrent
stuff step by step.

 From what I can see now that is that Elixir is in some cases a reaction
to Erlang. Or should I say was?

## Strings
While reading about Erlang one of the most raised concerns in regard of
everyday programming is Strings. So the first thing I did was looking
for a string module in Elixir. There is none. Wouldn't that be handy? I
mean String.length, String.rev and stuff like that.

## OO
A few sources on the web about Elixir mention a thin OO layer. Is this
something that has changed into a more clojure-like, interface-centric
concept? I cant't see any reference to OO in the current docs.

## Server Example
Ok, this is simply a suggestion, or maybe a wish. I think it would be
cool to show with a simple example how to setup and start a server. At
every important Node.js side you meet that async server example. I'm
sure that there is something similar laying around. It would be nice to
make it more visible. At least showing a small example in the
GettingStarted section.

## Compilation
My last wish. An entire sample how to build and run code with elixirc.

Thanks for the great work on Elixir.

Ben


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
José Valim  
View profile  
 More options Aug 30 2012, 10:04 am
From: José Valim <jose.va...@gmail.com>
Date: Thu, 30 Aug 2012 11:04:24 -0300
Local: Thurs, Aug 30 2012 10:04 am
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)

> I'm exploring Elixir and also Erlang. My target is to use it for a small
> web application. Since there is a lot to learn when it comes to Erlangs
> concurrent facilities, my intention was to start using Elixir like a
> arbitrary general purpose language and the approaching the concurrent stuff
> step by step.

Welcome!

My target is also to use Elixir for (not necessarily small) web
applications.
I am working on a web framework for Elixir too (
http://github.com/josevalim/dynamo).
It is currently under work but we should have an alpha release by the end
of September.
If you want to try or play with it regardless, join us at #elixir-lang on
freenode and feel free to ask me (josevalim).

> ## Strings
> While reading about Erlang one of the most raised concerns in regard of
> everyday programming is Strings. So the first thing I did was looking for a
> string module in Elixir. There is none. Wouldn't that be handy? I mean
> String.length, String.rev and stuff like that.

You are correct. Check the Binary module. :)

> ## OO
> A few sources on the web about Elixir mention a thin OO layer. Is this
> something that has changed into a more clojure-like, interface-centric
> concept? I cant't see any reference to OO in the current docs.

Yes, we have moved away from OO (it didn't suit well with immutability). We
are working with behaviours (from Erlang, somewhat similar to interfaces)
and protocols (similar to Clojure's).

> ## Server Example
> Ok, this is simply a suggestion, or maybe a wish. I think it would be cool
> to show with a simple example how to setup and start a server. At every
> important Node.js side you meet that async server example. I'm sure that
> there is something similar laying around. It would be nice to make it more
> visible. At least showing a small example in the GettingStarted section.

Yes. We will reach this point eventually.
There is still a bunch of work to be done in docs, we will get there slowly.
Contributions are always welcome, if you want any help, come to
#elixir-lang!

> ## Compilation
> My last wish. An entire sample how to build and run code with elixirc.

There is a mix chapter on the getting started guide that talks about
creating and building Elixir projects:

http://elixir-lang.org/getting_started/mix.html

Is that enough? What could be improved?

Thanks for the great work on Elixir.

Thank you for the feedback!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
José Valim  
View profile  
 More options Aug 30 2012, 10:26 am
From: José Valim <jose.va...@gmail.com>
Date: Thu, 30 Aug 2012 11:25:45 -0300
Local: Thurs, Aug 30 2012 10:25 am
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)

Ah, if you want to use Dynamo, you will need to install Elixir from master
(there are instructions for it in the getting started guide).

*
José Valim
www.plataformatec.com.br
Founder and Lead Developer
*


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben  
View profile  
 More options Aug 30 2012, 10:36 am
From: Ben <b...@mailworks.org>
Date: Thu, 30 Aug 2012 16:36:30 +0200
Local: Thurs, Aug 30 2012 10:36 am
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)
 > You are correct. Check the Binary module. :)

Yes, I was aware the that, but that is still a bit meager (sorry for the
negative word).
What is your take on Erlangs string processing? I mean is this something
Elixir should do fundamentally better? How much of a priority is it for
you?

 From my very distant standpoint it shouldn't be too difficult to make a
potential 'string.ex' part of the standard library. Scripters like me
are confused without ssssstrings :-)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
José Valim  
View profile  
 More options Aug 30 2012, 10:55 am
From: José Valim <jose.va...@gmail.com>
Date: Thu, 30 Aug 2012 11:55:34 -0300
Local: Thurs, Aug 30 2012 10:55 am
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)

> Yes, I was aware the that, but that is still a bit meager (sorry for the
> negative word).

Agreed. I am adding functions to the Binary module slowly. If you feel like
you need other functions, like delete, tr, gsub, sub, replace, etc, feel
free to contribute! I will gladly review your pull requests and exchange
ideas.
So far, I am adding just the functions I need when working on other Elixir
apps and libraries. So the growth right now is rather organic and slow.

What is your take on Erlangs string processing? I mean is this something

> Elixir should do fundamentally better? How much of a priority is it for you?

I think we already have a good foundation. We have a first class syntax for
utf-8 binaries, we have a nice syntax for regular expressions which does
not force you to double escape everything. We just need to improve the
built-in modules and functions, but that is the easy part. :)

It definitely has high priority, but since it is mostly me working on
Elixir (and other libraries) right now, it takes time. That's why
contributions are welcome! (and a great way to learn Elixir and Erlang!) ;)

> From my very distant standpoint it shouldn't be too difficult to make a
> potential 'string.ex' part of the standard library. Scripters like me are
> confused without ssssstrings :-)

The Binary module for now is supposed to do everything you would expect
from a bare "string.ex". The reason I don't want to call it String is
because we are not exactly sure what a String is. Is it a list? Is it a
binary? Both? Maybe a String module works with binaries but all functions
are utf-8 aware (for example, size would return the number of utf-8
endpoints instead the number of bytes)?

Cheers,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben  
View profile  
 More options Aug 30 2012, 11:28 am
From: Ben <b...@mailworks.org>
Date: Thu, 30 Aug 2012 17:28:09 +0200
Local: Thurs, Aug 30 2012 11:28 am
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)
Thanks for your interesting answers, one thing

 > The Binary module for now is supposed to do everything you would expect
 > from a bare "string.ex". The reason I don't want to call it String is
 > because we are not exactly sure what a String is. Is it a list? Is it a
 > binary? Both? Maybe a String module works with binaries but all
 > functions are utf-8 aware (for example, size would return the number of
 > utf-8 endpoints instead the number of bytes)?

hmmm, this seems to be no easy task. What if you were looking from the
outer side, not caring about the Erlang internals/semantics.

Try to stand in my shoes:

"I want the length of this string". String.length! Boom.
Or String.force-encoding("utf8")! Bam

I don't want to dance around dualities that might origin or not from
Erlang. Not from where I stand now.

Ok - is still still helpful? Probably not ...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benoit Martel  
View profile  
 More options Aug 30 2012, 12:55 pm
From: Benoit Martel <benoit.mar...@gmail.com>
Date: Thu, 30 Aug 2012 12:55:49 -0400
Local: Thurs, Aug 30 2012 12:55 pm
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)
Hi Ben,

Regarding this part of your question:

> ## Server Example
> Ok, this is simply a suggestion, or maybe a wish. I think it would be cool
> to show with a simple example how to setup and start a server. At every
> important Node.js side you meet that async server example. I'm sure that
> there is something similar laying around. It would be nice to make it more
> visible. At least showing a small example in the GettingStarted section.

I have had a very good experience working through the E2 tutorial as a
way to become more familiar with both Erlang and Elixir. E2 is a
simplified Erlang wrapper around the basic server behaviors from OTP.
It can be used as a gentle introduction to concurrency programming in
Erlang and get you to the point where you will be able to learn by
yourself the details of advanced OTP programming later. Since the
tutorial is in Erlang and I was actually following along by writting
all the code in Elixir, it really forced me to understand how things
work in practice and how to handle differences (e.g. I used binaries
while the example was using strings). I recommend it to anyone who
isn't already experienced with Erlang and wants to learn Elixir.

The website is: http://e2project.org/.
The quick start page shows you how to install E2 etc:
http://e2project.org/quick_start.html.
The interesting part is the tutorial where you build a disk-based
key-value store (database) that responds to queries over TCP sockets:
http://e2project.org/quick_start.html.

Regards,
-Ben


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben  
View profile  
 More options Aug 31 2012, 7:30 am
From: Ben <b...@mailworks.org>
Date: Fri, 31 Aug 2012 13:30:33 +0200
Local: Fri, Aug 31 2012 7:30 am
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)
Very interesting, thank you Benoit.

Now the obvious question: Is you code from the Elixir port somewhere
available?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benoit Martel  
View profile  
 More options Sep 3 2012, 9:16 pm
From: Benoit Martel <benoit.mar...@gmail.com>
Date: Mon, 3 Sep 2012 21:16:10 -0400
Local: Mon, Sep 3 2012 9:16 pm
Subject: Re: A couple of questions (Strings, OO, Server, Compilation)

Hi Ben,

I didn't have time to review it and set it up on github. I figured
sending this directly was better than sending nothing.

Here is my Elixir source code for the E2 tutorial. You can just put
these files in the source directory of the tutorial, replacing the
Erlang files there. I then use the following command to compile these
files: "elixirc -o ../ebin/. -pa ../deps/e2/ebin/. *.ex".

-Ben

  MyDB_App.ex
< 1K Download

  MyDB_Client_Handler_Sup.ex
< 1K Download

  MyDB_Client_Handler.ex
2K Download

  MyDB_Data.ex
1K Download

  MyDB_DB.ex
1K Download

  MyDB_Server.ex
< 1K Download

  MyDB.app.src
< 1K Download

  MyDB.ex
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »