- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
gt4s (Google tokens for Scala)
Tue, 2011-10-04, 19:40
Hi,
I've been thinking a bit about problem with scala symbolic names that people cannot google. I believe it's genuine problem and I've run into it myself many times. However, I like many symbolic names used in Scala. How to keep them as they are and make them searchable thus much less obscure to newcomers?
I propose to introduce mapping from symbolic names to equivalent searchable terms that we could call Google tokens for Scala. Let me give an example of what I mean:
http://www.google.com/?q=scala+:: http://www.google.com/?q=scala+$colon$colon
See the difference? First gives you no useful results (:: is effectively ignored) but second one is much better. Google already returns some useful bits about :: even if we have no official convention for referring to :: in a google-friendly way.
What I'm proposing here is that we fully embrace this phenomena and exploit it to our advantage. It means that standard Scala tools (like Scaladoc) would provide both symbolic name (for user) and searchable token used by search engines. See Scaladoc when you hover your mouse over +: method:
https://i.minus.com/iWlge5p2sz9Fe.png
We could provide a simple service where you enter your query like "scala ::" and it gets instantly transformed into "scala $colon$colon" and you are automatically redirected to Google page filled with useful results (like pointers to relevant Scaladoc pages).
To sum up: I propose a simple, pragmatic way to improve our situation with symbolic names. I believe it would greatly help both beginners trying to find info about piece of code they saw on a blog. I'd start with adding clues for symbolic names to Scaladoc as shown on screenshot and providing simple service for query rewriting. To implement it we could use one of those cool cloudy services like Heroku announced recently. It feels like a fun project to work on.
Comments? Objections?
--
Grzegorz Kossakowski
I've been thinking a bit about problem with scala symbolic names that people cannot google. I believe it's genuine problem and I've run into it myself many times. However, I like many symbolic names used in Scala. How to keep them as they are and make them searchable thus much less obscure to newcomers?
I propose to introduce mapping from symbolic names to equivalent searchable terms that we could call Google tokens for Scala. Let me give an example of what I mean:
http://www.google.com/?q=scala+:: http://www.google.com/?q=scala+$colon$colon
See the difference? First gives you no useful results (:: is effectively ignored) but second one is much better. Google already returns some useful bits about :: even if we have no official convention for referring to :: in a google-friendly way.
What I'm proposing here is that we fully embrace this phenomena and exploit it to our advantage. It means that standard Scala tools (like Scaladoc) would provide both symbolic name (for user) and searchable token used by search engines. See Scaladoc when you hover your mouse over +: method:
https://i.minus.com/iWlge5p2sz9Fe.png
We could provide a simple service where you enter your query like "scala ::" and it gets instantly transformed into "scala $colon$colon" and you are automatically redirected to Google page filled with useful results (like pointers to relevant Scaladoc pages).
To sum up: I propose a simple, pragmatic way to improve our situation with symbolic names. I believe it would greatly help both beginners trying to find info about piece of code they saw on a blog. I'd start with adding clues for symbolic names to Scaladoc as shown on screenshot and providing simple service for query rewriting. To implement it we could use one of those cool cloudy services like Heroku announced recently. It feels like a fun project to work on.
Comments? Objections?
--
Grzegorz Kossakowski
Thu, 2011-10-06, 10:07
#2
Re: gt4s (Google tokens for Scala)
The encoding part is pretty easy.
scala> import scala.tools.scalap._
import scala.tools.scalap._
scala> Names.encode("::")
res0: String = $colon$colon
scala> Names.encode(":+=->")
res1: String = $colon$plus$eq$minus$greater
Le 04/10/2011 20:40, Grzegorz Kossakowski a écrit :
scala> import scala.tools.scalap._
import scala.tools.scalap._
scala> Names.encode("::")
res0: String = $colon$colon
scala> Names.encode(":+=->")
res1: String = $colon$plus$eq$minus$greater
Le 04/10/2011 20:40, Grzegorz Kossakowski a écrit :
9LNVNDE_G5aEwB3gBKiC-Q [at] mail [dot] gmail [dot] com" type="cite">Hi,
I've been thinking a bit about problem with scala symbolic names that people cannot google. I believe it's genuine problem and I've run into it myself many times. However, I like many symbolic names used in Scala. How to keep them as they are and make them searchable thus much less obscure to newcomers?
I propose to introduce mapping from symbolic names to equivalent searchable terms that we could call Google tokens for Scala. Let me give an example of what I mean:
http://www.google.com/?q=scala+:: http://www.google.com/?q=scala+$colon$colon
See the difference? First gives you no useful results (:: is effectively ignored) but second one is much better. Google already returns some useful bits about :: even if we have no official convention for referring to :: in a google-friendly way.
What I'm proposing here is that we fully embrace this phenomena and exploit it to our advantage. It means that standard Scala tools (like Scaladoc) would provide both symbolic name (for user) and searchable token used by search engines. See Scaladoc when you hover your mouse over +: method:
https://i.minus.com/iWlge5p2sz9Fe.png
We could provide a simple service where you enter your query like "scala ::" and it gets instantly transformed into "scala $colon$colon" and you are automatically redirected to Google page filled with useful results (like pointers to relevant Scaladoc pages).
To sum up: I propose a simple, pragmatic way to improve our situation with symbolic names. I believe it would greatly help both beginners trying to find info about piece of code they saw on a blog. I'd start with adding clues for symbolic names to Scaladoc as shown on screenshot and providing simple service for query rewriting. To implement it we could use one of those cool cloudy services like Heroku announced recently. It feels like a fun project to work on.
Comments? Objections?
--
Grzegorz Kossakowski
-- Sylvain HENRY PhD Student INRIA/LaBRI RunTime Team Tel: +33 (0)6-70-94-86-76 http://hsyl20.fr
Thu, 2011-10-06, 11:27
#3
Re: gt4s (Google tokens for Scala)
I think it's a good idea. To do encode/decode, simply use:
scala.reflect.NameTransformer.{encode,decode}.
Cheers
Thu, 2011-10-06, 15:07
#4
Re: gt4s (Google tokens for Scala)
Okay. I've added "gt4s" to Scaladoc.
https://codereview.scala-lang.org/fisheye/changelog/scala-svn?cs=25798
On Thu, Oct 6, 2011 at 7:20 PM, martin odersky wrote:
> I think it's a good idea. To do encode/decode, simply use:
>
> scala.reflect.NameTransformer.{encode,decode}.
>
> Cheers
>
> -- Martin
>
> On Thu, Oct 6, 2011 at 10:57 AM, Sylvain HENRY wrote:
>> The encoding part is pretty easy.
>>
>> scala> import scala.tools.scalap._
>> import scala.tools.scalap._
>>
>> scala> Names.encode("::")
>> res0: String = $colon$colon
>>
>> scala> Names.encode(":+=->")
>> res1: String = $colon$plus$eq$minus$greater
>>
>>
>>
>> Le 04/10/2011 20:40, Grzegorz Kossakowski a écrit :
>>
>> Hi,
>> I've been thinking a bit about problem with scala symbolic names that people
>> cannot google. I believe it's genuine problem and I've run into it myself
>> many times. However, I like many symbolic names used in Scala. How to keep
>> them as they are and make them searchable thus much less obscure to
>> newcomers?
>> I propose to introduce mapping from symbolic names to equivalent searchable
>> terms that we could call Google tokens for Scala. Let me give an example of
>> what I mean:
>> http://www.google.com/?q=scala+::
>> http://www.google.com/?q=scala+$colon$colon
>> See the difference? First gives you no useful results (:: is effectively
>> ignored) but second one is much better. Google already returns some useful
>> bits about :: even if we have no official convention for referring to :: in
>> a google-friendly way.
>> What I'm proposing here is that we fully embrace this phenomena and exploit
>> it to our advantage. It means that standard Scala tools (like Scaladoc)
>> would provide both symbolic name (for user) and searchable token used by
>> search engines. See Scaladoc when you hover your mouse over +: method:
>> https://i.minus.com/iWlge5p2sz9Fe.png
>> We could provide a simple service where you enter your query like "scala ::"
>> and it gets instantly transformed into "scala $colon$colon" and you are
>> automatically redirected to Google page filled with useful results (like
>> pointers to relevant Scaladoc pages).
>> To sum up: I propose a simple, pragmatic way to improve our situation with
>> symbolic names. I believe it would greatly help both beginners trying to
>> find info about piece of code they saw on a blog. I'd start with adding
>> clues for symbolic names to Scaladoc as shown on screenshot and providing
>> simple service for query rewriting. To implement it we could use one of
>> those cool cloudy services like Heroku announced recently. It feels like a
>> fun project to work on.
>> Comments? Objections?
>> --
>> Grzegorz Kossakowski
>>
>>
>>
>> --
>> Sylvain HENRY
>> PhD Student INRIA/LaBRI RunTime Team
>> Tel: +33 (0)6-70-94-86-76
>> http://hsyl20.fr
>
>
>
> --
> Martin Odersky
> Prof., EPFL and Chairman, Typesafe
> PSED, 1015 Lausanne, Switzerland
> Tel. EPFL: +41 21 693 6863
> Tel. Typesafe: +41 21 691 4967
>
Thu, 2011-10-06, 16:37
#5
Re: gt4s (Google tokens for Scala)
On 6 October 2011 15:57, Kato Kazuyoshi <kato.kazuyoshi@gmail.com> wrote:
Sweet!
Thanks Kate for quick action. We'll have to wait couples of days/weeks before Google learns about this change.
I'll try to work on gt4s service on a weekend that will make this easy to use for people.
--
Grzegorz Kossakowski
Okay. I've added "gt4s" to Scaladoc.
https://codereview.scala-lang.org/fisheye/changelog/scala-svn?cs=25798
Sweet!
Thanks Kate for quick action. We'll have to wait couples of days/weeks before Google learns about this change.
I'll try to work on gt4s service on a weekend that will make this easy to use for people.
--
Grzegorz Kossakowski
Fri, 2011-10-07, 04:37
#6
Re: gt4s (Google tokens for Scala)
I have made a small test here: http://hsyl20.fr:8080/scoogle/
Indeed we need to wait for google to update its index.
Le 06/10/2011 17:30, Grzegorz Kossakowski a écrit :
Indeed we need to wait for google to update its index.
Le 06/10/2011 17:30, Grzegorz Kossakowski a écrit :
EDE7g [at] mail [dot] gmail [dot] com" type="cite"> On 6 October 2011 15:57, Kato Kazuyoshi <kato [dot] kazuyoshi [at] gmail [dot] com" rel="nofollow">kato.kazuyoshi@gmail.com> wrote:
Okay. I've added "gt4s" to Scaladoc.
https://codereview.scala-lang.org/fisheye/changelog/scala-svn?cs=25798
Sweet!
Thanks Kate for quick action. We'll have to wait couples of days/weeks before Google learns about this change.
I'll try to work on gt4s service on a weekend that will make this easy to use for people.
--
Grzegorz Kossakowski
Fri, 2011-10-07, 08:07
#7
Re: gt4s (Google tokens for Scala)
Hi,
Your test is a little bit too testy: it translates spaces to $u0020 ;-) You should leave spaces and quotes alone, at the very least.
Great idea, btw!
Sébastien
On Fri, Oct 7, 2011 at 05:34, Sylvain HENRY <hsyl20@gmail.com> wrote:
Your test is a little bit too testy: it translates spaces to $u0020 ;-) You should leave spaces and quotes alone, at the very least.
Great idea, btw!
Sébastien
On Fri, Oct 7, 2011 at 05:34, Sylvain HENRY <hsyl20@gmail.com> wrote:
I have made a small test here: http://hsyl20.fr:8080/scoogle/
Indeed we need to wait for google to update its index.
Le 06/10/2011 17:30, Grzegorz Kossakowski a écrit :On 6 October 2011 15:57, Kato Kazuyoshi <kato.kazuyoshi@gmail.com> wrote:
Okay. I've added "gt4s" to Scaladoc.
https://codereview.scala-lang.org/fisheye/changelog/scala-svn?cs=25798
Sweet!
Thanks Kate for quick action. We'll have to wait couples of days/weeks before Google learns about this change.
I'll try to work on gt4s service on a weekend that will make this easy to use for people.
--
Grzegorz Kossakowski
Mon, 2011-10-17, 00:07
#8
Re: gt4s (Google tokens for Scala)
On Tuesday 04 October 2011, Grzegorz Kossakowski wrote:
> Hi,
>
> I've been thinking a bit about problem with scala symbolic names that
> people cannot google. I believe it's genuine problem and I've run
> into it myself many times. However, I like many symbolic names used
> in Scala. How to keep them as they are and make them searchable thus
> *much* less obscure to newcomers?
>
> ...
>
> Comments? Objections?
I think it would be smarter just to get Google Code Search [1] to know
about Scala, which, surprisingly, is not among the 72 languages it does
explicitly support!
[1] http://www.google.com/codesearch
Randall Schulz
Mon, 2011-10-17, 00:17
#9
Re: gt4s (Google tokens for Scala)
2011/10/16 Randall R Schulz :
> On Tuesday 04 October 2011, Grzegorz Kossakowski wrote:
>> Hi,
>>
>> I've been thinking a bit about problem with scala symbolic names that
>> people cannot google. I believe it's genuine problem and I've run
>> into it myself many times. However, I like many symbolic names used
>> in Scala. How to keep them as they are and make them searchable thus
>> *much* less obscure to newcomers?
>>
>> ...
>>
>> Comments? Objections?
>
> I think it would be smarter just to get Google Code Search [1] to know
> about Scala, which, surprisingly, is not among the 72 languages it does
> explicitly support!
>
> [1] http://www.google.com/codesearch
>
>
> Randall Schulz
>
Unfortunately, it'll be shut it down in 3 months, see
http://googleblog.blogspot.com/2011/10/fall-sweep.html.
On 4 Oct 2011, at 19:40, Grzegorz Kossakowski wrote:
> I propose to introduce mapping from symbolic names to equivalent searchable terms that we could call Google tokens for Scala.
This is an *excellent* idea - I've beaten my head against this on more than a few occasions and I can't see how this could possibly fail to help :-)
--
paul.butcher->msgCount++
Snetterton, Castle Combe, Cadwell Park...
Who says I have a one track mind?
http://www.paulbutcher.com/
LinkedIn: http://www.linkedin.com/in/paulbutcher
MSN: paul@paulbutcher.com
AIM: paulrabutcher
Skype: paulrabutcher