juan_gandhi: (Default)
2021-06-10 05:15 pm
Entry tags:

не могу объяснить, но

У меня есть набор тестов с топосной логикой; там расчеты довольно тяжелые; часа 2 с лишним уходило.

Переключился сейчас со скалы 2.12 на скалу 2.13, и jvm с 7 на 11.

В два раза быстрее. 

juan_gandhi: (Default)
2019-02-24 05:04 pm
Entry tags:

wtf with type name

I have a class named `Category`, and it has a member `type Object`, so far so good.
But then in one place the compiled code (or JVM) does not understand that it is not `java.lang.Object`, and tries to find a method that takes `java.lang.Object` while the methods I have takes some path-dependent type named `Object`.

So, to avoid this stupidity with JVM (or scala compiler), I have to find an alternative name. Can't figure out what it can be. Just `O` (and `A` for arrows?)

I'm in panic.

juan_gandhi: (VP)
2013-05-20 06:00 pm
Entry tags:

about exceptions in jvm

Seems like scala people look down at exceptions... but see. The difference between an error message and an exception is that an exception tells you where the error happened. I actually use it in pretty unusual places, like this:
def jsREPL(implicit prompt:String = "type your js") {
  val here = Thread.currentThread().getStackTrace()(3)
  println(s"$prompt [${here.getFileName}:${here.getLineNumber}]: ")
  Source.fromInputStream(System.in).getLines.takeWhile(!_.isEmpty) foreach {
    s => println(tryOr(runJS(s), (_:Exception).getMessage))
  }


What I want to say: if we, in Scala, had a habit of passing around exceptions, instead of plain text, it would be pretty helpful.

Thinking about it.