Skip to content

Add bsp blog post #913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 15, 2018
Merged

Add bsp blog post #913

merged 13 commits into from
Jun 15, 2018

Conversation

jvican
Copy link
Member

@jvican jvican commented Jun 15, 2018

No description provided.

@jvican jvican requested review from heathermiller and olafurpg June 15, 2018 12:28
@jvican
Copy link
Member Author

jvican commented Jun 15, 2018

/cc @jastice would you mind having a look too? 😉

Copy link
Contributor

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job!

The compile gif could show more interesting compile errors like

  1. remove a method
  2. see errors in project
  3. navigate to error in the "build" panel

Syntax errors like removing d from def and adding bogus identifiers like asdfasd already work great in IntelliJ but changes that affect multiple files are usually are harder to work with.

Copy link
Contributor

@propensive propensive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! In a couple of places you've used "first", "second" and "last" where I would have used adverbs, "firstly", "secondly" and "lastly". This might be a more British preference, so I didn't comment on them, and there's no problem leaving them as they are.

Though "last but not least" is a stock phrase, so If you do decide to change the others, that one shouldn't change.

I've always been convinced that the choice of an editor, IDE or build tool is
personal and, therefore, asking you to go out of your way to learn a new tool
to write Scala is not a viable solution. First, because changing people's
habits is difficult and takes time. Second, it frustrates beginners that just
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/that/who/


Instead it is much better if we, tooling developers, can bear the burden of
shipping tools that integrate with your existing workflow and you, as a user,
can just install them with a quick search and a single click.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resent the need to click on anything! :D

can just install them with a quick search and a single click.

Today, I introduce the Build Server Protocol, a project that I believe plays
a fundamental role in bringing us closer to make this vision a reality.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/make/making/

### Relationship with the Language Server Protocol

If you have heard of Microsoft's [Language Server Protocol][LSP], you may be
wondering what's the relationship between these two protocols. BSP and LSP
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering what the relationship between these two protocols is - move the is to the end of the sentence as if it's a subordinate clause in German!

It turns out that if we want to support Scala across editors like Visual
Studio Code, `vim` or Sublime via a Scala language server, we also need to
integrate with build tools to support features like compiler diagnostics or
code navigation. One of the main focus of BSP is that it can be implemented
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/focus/focuses/

involved in its development is to open an issue or pull request to
[`scalacenter/bsp`](https://github.com/scalacenter/bsp). Most of the features
in the specification have tickets and review discussions elaborating on the
design goals, like this [closed](https://github.com/scalacenter/bsp/issues/3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/this/these/ but consider rewording some other way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i know there was something wrong here, thanks 👍

If you want to help integrating BSP in your favorite editor or IDE, or you'd
like to help test the integrations, join our
[`scalacenter/bsp`](https://gitter.im/scalacenter/bsp/) Gitter channel and
let's discuss about ways we can work together.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete about


I'd like to thank my colleague at the Scala Center, Ólafur Páll Geirsson, for
being the co-author of the Build Server Protocol. His help and insights, as
well as his close understanding of [LSP], have been fundamental in designing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/close/detailed/ sounds better


Finally, I'd like to thank Justin Kaeser and, more broadly, JetBrains for
being part of this initiative. It feels great to collaborate with other
parties to have a positive impact in the tools we provide to the Scala
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/in/on/
s/we provide/we are providing/ - I think that makes it sound more active!


[sbt]: https://www.scala-sbt.org/
[Maven]: http://maven.apache.org/
[Gradle]: aa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can just install them with a quick search and a single click.

Today, I introduce the Build Server Protocol, a project that I believe plays
a fundamental role in bringing us closer to make this vision a reality.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closer to making?

I've always been convinced that the choice of an editor, IDE or build tool is
personal and, therefore, asking you to go out of your way to learn a new tool
to write Scala is not a viable solution. First, because changing people's
habits is difficult and takes time. Second, it frustrates beginners that just
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beginners who just ?

Most of them provide "Export Project" capabilities so that user adoption is
not hurt by lack of official IDE support. This support isn't as thorough and
polished as the one provided by IDEs, but usually gets the job done at the
cost of supported features.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the expense of supported features?


How does this work? First, you export your project from your build to Bloop.
This process takes usually ~10s for a medium-sized project (highly
recommended to use [coursier] in your build for upmost speed) and exists so
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is highly recommended? We highly recommend that you use?

How does this work? First, you export your project from your build to Bloop.
This process takes usually ~10s for a medium-sized project (highly
recommended to use [coursier] in your build for upmost speed) and exists so
that Bloop can understand different build tools. Then, the IDE imports it
Copy link
Contributor

@Duhemm Duhemm Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it refer to in this sentence? I think it is "the bloop configuration" but you don't mention it.

and IDEs because the communication is bidirectional.

Further, this two-step process can be improved in the future. First, bloop
could run `bloopInstall` every time you start up your sbt shell or `reload`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bloop could export your build every time


Further, this two-step process can be improved in the future. First, bloop
could run `bloopInstall` every time you start up your sbt shell or `reload`
your build. Second, Bloop's Build Server could send notifications the IDE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

send notifications to the IDE


## Next steps

The next steps will focus on two main areas: adoption and user impact. First,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user impact sounds strange, what do you mean here?

[Gradle]: aa
[Bazel]: aa
[Pants]: aa
[mill]: aa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to update the links :)


As a result, end users are provided with the best developer experience and
tooling developers can improve the quality of their integrations with less
effort and time, without locking out a part of the Community from good Scala
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Community should be lowercase here

It turns out that if we want to support Scala across editors like Visual
Studio Code, `vim` or Sublime via a Scala language server, we also need to
integrate with build tools to support features like compiler diagnostics or
code navigation. One of the main focus of BSP is that it can be implemented
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the main foci*

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Euax ad Latinam!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wow, i feel so cultivated using this word 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK guys, i got impostor syndrome and decided to go for the classic "properties".

language support and get compiler diagnostics from the build tool in
IntelliJ's editor.

How does this work? First, you export your project from your build to Bloop.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to expand on this. You have to provide more context. What are you going to explain to people how to do? What does "export your project to Bloop" mean? Keep in mind that people reading this might still have no idea what Bloop is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out! I'm clarifying this in the text.


How does this work? First, you export your project from your build to Bloop.
This process takes usually ~10s for a medium-sized project (highly
recommended to use [coursier] in your build for upmost speed) and exists so
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utmost speed to do what? Please be explicit for people who don't know what coursier is.

language support and get compiler diagnostics from the build tool in
IntelliJ's editor.

How does this work? First, you export your project from your build to Bloop.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean exactly? More context needed here. Say what exactly you're going to use BSP to do (you don't say it explicitly). Also, what does it mean to "export your project from your build to Bloop"? It's not totally clear to me. And finally, don't assume that everyone reading this is familiar with Bloop...


![Demo of BSP import for akka/akka](/resources/img/bloop-install.gif)

In my experience, importing a build via BSP is substantially faster than
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the main concern really speed? Why focus so much on this? I thought the main reason for this was compatibility.

can take minutes. It also enables smarter communication between build tools
and IDEs because the communication is bidirectional.

Further, this two-step process can be improved in the future. First, bloop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which two-step process? Be explicit. Actually say somewhere in the text that the process for importing a build involves two steps:

  1. Step 1: ...
  2. Step 2: ...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You talk about improving a two-step process without defining what it is first 😉


To learn more about the Build Server Protocol, check out the
[slides](http://jorge.vican.me/slides/BSP.pdf) of my talk with Justin at
Scalasphere 2018.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think a lot of high-level information is missing. What's the relationship between this bsp artifact that you link to and bloop? These are two artifacts and if I read this pretending I've never heard of this work before, it's not clear to me how these things are related and why you're talking about this weird thing called Bloop 😉


Second, there is work to do to create a better synergy between build tool
authors and IDE implementors. The [Scala Tooling Protocol Working Group]()
that the Scala Center created a few months ago will help us discuss and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jon created it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it's probably better not to attribute it to me!

Maybe say the group "was formed" (impersonal) rather that being created by anyone.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added Jon 😉


In my experience, importing a build via BSP is substantially faster than
doing so via the traditional sbt or Maven project import where the process
can take minutes. It also enables smarter communication between build tools
Copy link
Contributor

@julienrf julienrf Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure this is fair. IntelliJ opens sbt projects in instant time, and then all the project’s dependencies are downloaded in the background. You don’t have to wait for minutes to start working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we're talking about the same thing. Are you talking about the workflow after you've imported the project, you close IntelliJ and then you open it up again? Project's dependencies are not downloaded by IntelliJ but by sbt during the import process and the process to do so is slow even if the dependencies are already downloaded. For example, import zinc in IntelliJ (just tried it) takes 2 minutes! That's the price I need to pay every time I update a dep in my build so that the IDE knows about it.

Copy link
Contributor

@julienrf julienrf Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(sorry to pollute the PR with that discussion…)

No, I’m talking about importing an sbt project for the first time in IntelliJ. I’ve just tried with zinc and while the project is imported in the background (this has indeed taken one minute) you can still work on it. That’s why I think it’s not fair to formulate things in a way that make people believe that you will cut several minutes of waiting.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depends, the instant opening only sort-of works for simple projects with standard layout and provides only the editor

Copy link
Member Author

@jvican jvican Jun 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I’m talking about importing an sbt project for the first time in IntelliJ. I’ve just tried with zinc and while the project is imported in the background (this has indeed taken one minute)

It took two minutes for me. And in my case, I cannot work on it because if I open up sbt it will collide with the sbt shell that IntelliJ has created, and the indices need to be created and updated.

Think of a user that adds a dependency and wants to instantly use it in IntelliJ, but doesn't know its API by heart. He/she will need to wait for IntelliJ to fully index the project, which will happen after several minutes.

Copy link
Member

@heathermiller heathermiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good so far... Needs a bit more context on general though.

[`scalacenter/bsp`](https://gitter.im/scalacenter/bsp/) Gitter channel and
let's discuss about ways we can work together.

## Acknoledgements
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Acknowledgements

@jvican
Copy link
Member Author

jvican commented Jun 15, 2018

I'm ready for the second round guys! Thank you, it's exciting to see so many reviews and suggestions 😄.

@jvican
Copy link
Member Author

jvican commented Jun 15, 2018

In the meanwhile, I'll be working on a better way to showcase errors!

@jvican
Copy link
Member Author

jvican commented Jun 15, 2018

Merging upon heathers offline approval 😁

@jvican jvican merged commit 1d8fd72 into scala:master Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants