DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Languages
  4. Oy, scalac

Oy, scalac

David Pollak user avatar by
David Pollak
·
Jan. 04, 13 · Interview
Like (0)
Save
Tweet
Share
3.89K Views

Join the DZone community and get the full member experience.

Join For Free

I really hate when this happens

I burned most of my productive time on Tuesday with an infinite loop in the Scala compiler. It made me very, very grumpy.

First, you can find the code that reproduces the problem in the Visi repository.

To reproduce the problem, clone the repository, checkout the scala_infinite_loop branch, cd visi/core/scala, type sh sbt11, and in sbt, type compile and then test.

The following lines cause the infinite compiler loop (lines 200-202):

private def lineFeed: Rule0 = rule {
  zeroOrMore(EOL | EOI)
}

But, if you change the code to:

private def lineFeed: Rule0 = rule {
  zeroOrMore(EOL)
}

The code compiles and tests just fine.

Why this is a problem

So, in most computer languages, it's not a problem to have a bug in the compiler... complex systems have complex bugs.

The problems that I see here are:

  1. The problem manifests itself when program B is compiled against program A and the type signatures have not changed between the two code inputs. This is a serious problem.
  2. I cannot change to a different release of the compiler because of Scala's version fragility issue. Yes, I spent more than an hour looking for Scala 2.9.1 and 2.10.0-RC?? versions of the libraries that Visi depends on and the only combination of the libraries I needed were in Scala 2.9.2.
  3. It takes a long time to fix bugs in the compiler like this pattern matching bug that took 4 years to get fixed.

My switching costs are too high

I've spent 6 years learning Scala, writing web frameworks for Scala, writing books about Scala, and bending my brain to code the Scala way. Building a complex system in something that's not Scala is more than I can do right now. My switching costs away from Scala are too high.

Yeah, I know I'm likely to be insulted for pointing out the fact the Scala is not yet ready for prime time, even after 2 years and more than $3M of investment in a commercial Scala company. But, I've been a huge advocate for the value of Scala (it's awesome for small, hot teams like Twitter and Foursquare). It's equally true that if you adopt Scala, many of the benefits to the developers can be destroyed by the bugs, the versioning challenges, the challenges of having legitimate concerns being heard by a community that's steeped in academia, and the value of research over stability.

Choose Scala wisely.

Scala (programming language)

Published at DZone with permission of David Pollak. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Artificial Intelligence in Drug Discovery
  • Public Cloud-to-Cloud Repatriation Trend
  • Distributed Stateful Edge Platforms
  • SAST: How Code Analysis Tools Look for Security Flaws

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: