Channelã¹ã¿ã¤ã«ã®ä¸¦è¡å¦çã®è¨è¿°ã(ãã¡ããåå®å ¨ã«)å¯è½ã«ããã©ã¤ãã©ãªOxã«ã¤ãã¦èª¿ã¹ã¦è©¦ãã¦ã¿ããçµè«ããè¨ãã¨æ¸ãå³ããã¡ããã¡ãè¯ãã¦é¢ç½ãã ã½ã¼ã¹ã³ã¼ããç½®ãã¦ããã github.com Ox Oxã¨ã¯ãsttpãªã©ã®éçºã§ã馴æã®SoftwareMillã«ãã£ã¦éçºããã¦ããScalaç¨ã®éåæã©ã¤ãã©ãªã§ãããã¾ã é常ã«è¥ããæ´»çºã«éçºããã¦ããã github.com Oxã®ç¹å¾´ã¯ãã¨ãããç®çã¨ãã£ã¦ãå·®ãæ¯ããªãã®ã ããããã¯Channelæåã®éåæå¦çãã¤ã¾ãGoroutineãScalaã®ä¸ã§å®ç¾ãã¦ããç¹ã ãGoã¦ã¼ã¶ãªãããã«ç解ã§ããã ããã ç¾èã¯ä¸è¦ã«å¦ããããããªæãã®ã³ã¼ããæ¸ããã¨ãã§ãã(v0.0.25æç¹)ã import ox.* import ox.channels.* import scala.concurrent.durat
ããªãã¿ã®ç»å JavaãScalaã¨ãã£ãJVMè¨èªã®Dockerã¤ã¡ã¼ã¸ã¯ãJVMãå梱ããªããã°ãªããªãé½åã§è¥å¤§åããã¡ã§ãããç¹ã«ä½ãããªãã¦ããä¾ãã°ä¸è¬çãªamazoncorretto:21ã®ã¤ã¡ã¼ã¸ãµã¤ãºã¯217.7 MBãããã hub.docker.com ããã«ããã«ãã«ãæ¸ã¿ã®JARãã¡ã¤ã«ãè¼ã£ã¦ããã®ã§ãçµæ§å¤§ãããªã£ã¦ãã¾ãã®ã ã ããã§ãScalaã®ã³ã³ããã¤ã¡ã¼ã¸ã®ãµã¤ãºããªãã¨ãå°ããã§ããªããã¨ãèãããããã¨ãJVMã使ã£ãã¾ã¾70 MiBãããã«ç¸®ãããã¨ãã§ããã github.com ã³ã³ããã¤ã¡ã¼ã¸ã®ãµã¤ãºãå°ããããããã«ãä½ãããããæ¸ãã¦ãããã¡ãªã¿ã«é¡æã¨ããã¢ããªã±ã¼ã·ã§ã³ã¯ã¡ãã£ã¨ããHello, Worldãããã ãã®ãã®ã§ãã©ã¤ãã©ãªã¯Catsã«ä¾åãããã JVM使ãç·¨ ãã«ãã¹ãã¼ã¸ãã«ããè¡ã Alpineãªã©ã®è»½éã©ã³
Scala 3ã«ããããã¼ã¿æåããã°ã©ãã³ã°ï¼ä»¥ä¸DOPï¼ã«ã¤ãã¦æ·±æããããä¹ ã ã«Scalaã®è©±é¡ãåãä¸ããããããã¯Scala Advent Calendar 2023ã®14æ¥ç®ã®å 容ã§ãããã æ©éã ãã©ãDOPã®åºæ¬ååã¯æå¤ã¨ã·ã³ãã«ã ã ã³ã¼ãï¼åä½ï¼ããã¼ã¿ããåãé¢ã ãã¼ã¿ãæ±ç¨çãªãã¼ã¿æ§é ã§è¡¨ç¾ãã ãã¼ã¿ãã¤ãã¥ã¼ã¿ãã«ï¼ä¸å¤ï¼ã¨ãã¦æ±ã ãã¼ã¿ã¹ãã¼ãããã¼ã¿è¡¨ç¾ããåãé¢ã ã¤ãã¥ã¼ã¿ãã«ãªãã¼ã¿ã¯æ¡ç¨ãããã¨ã¯å¤ãã¨æãããããããã®ã¾ã¾å®è·µãã¦ãã人ã¯ã©ã®ãããããã ããããScalaã§ã¯ã¯ã©ã¹ä¸å¿ã®é¢æ°åããã°ã©ãã³ã°ã主æµã ã¨æãããç§ããããã¦ããã DOPã®è©³ç´°ã¯ä¸è¨ã®æ¬(以ä¸DOPæ¬)ãåç §ãã¦ã»ããã ãã¼ã¿æåããã°ã©ãã³ã° ä½è :Yehonathan Sharvitç¿æ³³ç¤¾Amazon ã¡ãªã¿ã«çæãã¹ãç¹ããããDOPæ¬ã¨Javaã®Pro
ã¾ããRust ã§ã¯Result ã§å¤±æããé¢æ°ã Option 㧠None ã«ãªãå¦çã« ? ãã¤ãããã¨ã§å¦çã short-circuit ãã¦æãåºãã. ãã㯠TypeScript ã Kotlin ã® optional chaining ã Result åã«ãæ¡å¼µãããã®ã¨ãã¦ã¿ããã¨ãã§ãã. Rust: Result ã® short-circuit pub fn f() -> Result<i32,String> { let str = may_fail_with_string()?; let i = str.parse::<i32>().map_err(|_| "error message".to_string())?; Ok(i) } fn may_fail_with_string() -> Result<String,String> { todo!() }
æ°ã¶æåã«ãplayframeworkã®Scala 3対å¿çãªãªã¼ã¹è¨å¿µã«play 2.9ã®ãã¤ã«ã¹ãã¼ã³ã§Netty backendã§åããã®ãæ¸ããã®ã§ããã æ¨æ¥æ¸ããããã«äºå®éãplayframework 3.0ã®pekko対å¿ã®æºåã¨ãã¦ãã¤ã«ã¹ãã¼ã³( 3.0.0-M1 )ããªãªã¼ã¹ãããã®ã§ãåããããªãã®ãè²¼ã£ã¦ããã¾ãã ãã㧠akkaã®ä¾åã¯ã¼ã (playframeworké¢ä¿ãªãç¾ç¶å¿ ãã¤ãã¦ãã)Scala 2ã®scala-library以å¤ã¯Scala 2.13ã®jarã®ä¾åãã¼ã ã¨ããç¶æ ã®ã¯ãã§ãã playframeworkã¯3ããmavenã®groupIdã com.typesafe.play ãã org.playframework ã«å¤ãã£ã¦ããã®ã§æ³¨æãã¾ãããã 以åã®play 2.9ã®Nettyç https://gist.github.
Scala CLIã«ã¯Java Microbenchmark Harness (JMH)ã使ã£ããã³ããã¼ã¯ãåãããã®æ©è½ããããJMHã§ã¯ãããã¤ãã®ã¢ããã¼ã·ã§ã³ãã¤ãã¦ããã°ã©ã ãèµ·åãããã¨ã§ãèªåçã«ãã©ã¡ã¼ã¿ã調æ´ãããã³ããã¼ã¯ãå®è¡ãã¦ãããããã³ããã¼ã¯ã¯ã¡ã½ããåä½ã®å°è¦æ¨¡(Microbenchmarkã®ååã¯ããã«ç±æ¥ãã)ã§è¡ãªãããã¹ã«ã¼ããããªã©ãè¨ç®ãã¦ãããã github.com ãã®è¨äºã§ã¯ãJMHãå©ç¨ãããã³ããã¼ã¯ä½æã®åæ©ã¨ããããScala CLIã§å®è¡ããæ¹æ³ã«ã¤ãã¦èª¬æããã Scala CLI ä»åå©ç¨ããScala CLIã®ãã¼ã¸ã§ã³ã¯ä»¥ä¸ã®éãã % scala-cli version Scala CLI version: 1.0.4 Scala version (default): 3.3.0 Scala CLIãã¤ã³ã¹ãã¼ã«ãã
Scala 3ã§ã¯ã以ä¸ã®ããã« | ã¨ããunion typeï¼or typeï¼ã¨ããæ°ããä»æ§ã追å ããã¾ããã (ä»æ§ã¨ããããå°ãªãã¨ã以ä¸ã®å ¬å¼ããã¥ã¡ã³ãã§ã¯unionã¨å¼ãã§ãããScala 3ã®quoteã®APIå é¨ã§ã¯OrTypeã§ããããã) https://docs.scala-lang.org/scala3/book/types-union.html Welcome to Scala 3.3.0-RC3 (11.0.18, Java OpenJDK 64-Bit Server VM). Type in expressions for evaluation. Or try :help. scala> List(2, "a") val res0: List[Int | String] = List(2, a) ãããããããScala 2ã§ãããªã£ãããå½ç¶ä»¥ä¸ã®ããã«
ãã®è¨äºã¯ Scala Advent Calender 2022 20æ¥ç®ã®è¨äºã§ãã ã¯ããã« è¨èªãµã¼ãã¼ã Scala ã§æ¸ãããã¨æãç«ã£ãã®ã§ãããlsp4j çã®ã©ã¤ãã©ãªã使ãã¨è¨èªãµã¼ãã¼ãåä½ãããããã« JVM ãå¿ è¦ã«ãªã£ã¦ãã¾ããããJVM ã§ã¯ãªã nodejs ã«ä¾åããè¨èªãµã¼ãã¼ã Langoustine ã¨ããã©ã¤ãã©ãªãå©ç¨ãã¦æ¸ãã話ã§ãã Langoustine ã§è¨èªãµã¼ãã¼ãä½ãã«ããã£ã¦ Effect runtime ã¨ã㦠Cats Effect ã® IO ã使ç¨ãã¦ãã¾ãã ãåç¥ãªãæ¹ã§ãé°å²æ°ã§èªããã¨ã¯æãã¾ãããã¡ããã©1é±éåã« Scala Advent Calender 2022 13æ¥ç®ã®è¨äºã¨ã㦠Cats Effect 使ã£ã¦ã¿ãã¨ããè¨äºãä¸ãã£ã¦ãã¾ãã®ã§èªãã§ã¿ãã¨è¯ãããç¥ãã¾ããã ã¯ã©ã¤ã¢ã³ãå´å®è£ ãå«ãå®å ¨ãª
ãã®è¨äºã¯ Scala Advent Calendar 2022 ã®7æ¥ç®ã空ãã¦ããã®ã§ããã¨ããæ稿ããè¨äºã§ããã¢ãã£ã·ã§ãã«ã¿ã¤ã ã¿ãããªãã®ã§ããã¿ã¤ãã«ã¯é£ãã§ãï¼ä¸å¿33åéãã¨ããæ ¹æ ã¯ãã¨ã®ã»ãã«â¦ï¼ ã¨ãã«2015å¹´ãGoogle ã®ã¨ã³ã¸ãã¢ãã Maven Central ã®ãã©ã¼ãå ¬éãã¾ããï¼ä»¥ä¸ããããã®ãã Google ãã©ã¼ã¨å¼ã³ã¾ãï¼ãGoogle ãã©ã¼ã®ç®çã¯ãMaven Central ä¸ã«ãã Java ã Scala ã®ã©ã¤ãã©ãªãªã©ããGoogle ã®ã¤ã³ãã©ã®ãã¯ã¼ã§é«éã«ãã¦ã³ãã¼ãã§ããããã«ãããã¨ã§ãéçºè ä½é¨ãåä¸ããããã§ããããã®å¾ã®æ°å¹´ã§å¤å°æ¸ãæ¹ã«å¤åãã£ãããã§ãããç°¡ç´ ãªããããã¼ã¸ã§ Maven ã§ã®ã°ãã¼ãã«ãªè¨å®æ¹æ³ãæ²è¼ããã¦ãã¾ãã ãã¦ãScala ã§ä¸»æµã®ãã«ãã·ã¹ãã sbt ã®ã°ãã¼ãã«ãªè¨å®æ¹æ³ã«
çªç¶ã§ãããçããsbtã®chrome traceåãåºãæ©è½ä½¿ã£ã¦ã¾ããï¼å¤§æµã®äººã¯ä½¿ã£ã¦ãªãã¨ããããåå¨ããç¥ããªãã¨æãã¾ãã https://github.com/sbt/sbt/pull/4576 以å以ä¸ã®ãããã§ãå¤å°è©±ãåºãã¾ãã https://xuwei-k.hatenablog.com/entry/2022/03/30/142529 ãã¦ãããã使ã£ã¦sbtã®buildã®sub projectæ¯ã®compileé度ãçºãã¦ãé ã®ä¸ã§DAGãæãã¦ã¿ãã¨ãã«ãç¨ã«ã ãtestã®ããã®ã¦ã¼ãã£ãªãã£ãåç §ãããããã« test->test ã追å ãã¦ãããããã®ããã§é ãã ã¨ãããã¿ã¼ã³ãããã¨æãã¾ãã ããã«å ±æãã¦ããããªãã¨è©±ãå§ã¾ããªãã®ã§ãããããã詳ãã説æããã¨é·ããªãã®ã§ãå¤å°ã大éæãªèª¬æã§æ¸ã¾ãã¾ããã https://github.com/x
追è¨(2023-04-04): Scala CLIã使ãã¾ããã Ammoniteããã¼ã¹ã«ããæ´ç·´ãããScala CLIãéçºãããScalaã®ããã¡ã¯ãã¹ã¿ã³ãã¼ãã¨ãã¦å®çãã¤ã¤ããã¾ããå ¬å¼ã«scalaã¨å ¥åããéã®æ¨æºã¢ããªã±ã¼ã·ã§ã³ã¨ãªããã¨ãäºè¦ããã¦ããããããã¡ããå¦ã¶ã¨ããã§ãããã scala-cli.virtuslab.org tanishiking24.hatenablog.com zenn.dev Ammoniteææ³æéãã¹ã¿ã¼ ãã®è¨äºã¯ãScalaã®ã¹ã¯ãªããã£ã³ã°ç°å¢ã§ããREPLã§ãããAmmoniteã®åºç¤çãªå©ç¨æ¹æ³ããã¹ã¿ã¼ããã¡ãã£ã¨åã£ãã·ã§ã«ã¹ã¯ãªãããAmmoniteã¹ã¯ãªããã«æ¸ãæããããç¨åº¦ã®Ammoniteåãæã«å ¥ããããã®ãã®ã§ãã 追è¨(2023-04-04): Scala CLIã使ãã¾ããã Ammoniteææ³æéã
ãã8æ1æ¥ãè¨ç®æ©ç§å¦ã®æ ¹å¹¹ãæºãããããã¹ã³åé¡ãåºé¡ãããã¨ã³ã¸ãã¢ãã¡ã¯éæ¼ããï¼æå³: é¢ç½åé¡ãåºãã®ã§ããªãã¹ããã³ãã³ãªè§£æ³ã使ã£ã¦å·±ã®æå·§ãèªç¤ºããããã«ã¨ã³ã¸ãã¢ãã¡ã¯ç«¶ã£ã¦ã³ã¼ããæ¸ãã¯ãããï¼ã ãåé¡ãé å{"ãã","ã¹ã³"}ããã©ã³ãã ã«è¦ç´ ãæ¨æºåºåãç¶ããããã®ä¸¦ã³ããããã¹ã³ã¹ã³ã¹ã³ãã3åç¹°ãè¿ãããã®ãã«ä¸è´ããã¨ãã«ãã©ãæ³¨å ¥â¡ãã¨æ¨æºåºåãã¦çµäºããããã°ã©ã ãä½æãã(é ç¹:5ç¹)â ((ð++)) (@Sheeeeepla) 2022å¹´8æ1æ¥ ããã§ãé¢æ°åãã¯ããã¯ããªãã¨ãããããã 解æ³ãä½ã£ãã®ã§ããã«ç¤ºãã import higherkindness.droste.Coalgebra import higherkindness.droste.data.list.{ListF, ConsF, NilF} import higherk
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}