This page is no longer maintained — Please continue to the home page at www.scala-lang.org

gt4s (Google tokens for Scala)

9 replies
gkossakowski
Joined: 2010-03-11,
User offline. Last seen 33 weeks 5 days ago.
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

paulbutcher
Joined: 2010-03-08,
User offline. Last seen 10 weeks 5 days ago.
Re: gt4s (Google tokens for Scala)

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

Sylvain HENRY
Joined: 2009-05-28,
User offline. Last seen 42 years 45 weeks ago.
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 :
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
odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
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

Kato Kazuyoshi
Joined: 2010-10-22,
User offline. Last seen 29 weeks 1 day ago.
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
>

gkossakowski
Joined: 2010-03-11,
User offline. Last seen 33 weeks 5 days ago.
Re: gt4s (Google tokens for Scala)
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

Sylvain HENRY
Joined: 2009-05-28,
User offline. Last seen 42 years 45 weeks ago.
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 :
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


sjrd
Joined: 2011-04-09,
User offline. Last seen 51 weeks 2 days ago.
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:
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



Randall R Schulz
Joined: 2008-12-16,
User offline. Last seen 1 year 29 weeks ago.
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

kmels
Joined: 2010-02-11,
User offline. Last seen 42 years 45 weeks ago.
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.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland