ç¶ç¶æ¸¡ãã»ã³ã¼ã«ããã¯ãèªã¿ãããããè¨èªæ©è½ãã¡ï¼Kokaã»Gleamã»Rocï¼
ç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ããããã¯ã³ã¼ã«ããã¯é¢æ°ã¯é常ã«å¼·åãªãã¯ããã¯ã ã
ä¾ãã°JavaScriptã§ã¯ãéåæå¦çãæ±ã.then
ã¡ã½ãããæåã©ããã ããã
fetch("http://example.com/movies.json") .then((response) => response.json()) .then((movies) => console.log(movies))
ç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ã¯èªã¿ã«ãããããã§ãJavaScriptã§ã¯asyncæ§æãå°å ¥ããã¦ããã
const response = await fetch("http://example.com/movies.json"); const movies = await response.json(); console.log(movies);
awaitã®æ¯ãèãã¯ã以ä¸ã®ãããªèªã¿æ¿ãã«ã¼ã«ãããã¨èããã¨ç解ããããã
const X = await P; E; => P.then((X) => E);
awaitã¯ãç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ã®éåæããã°ã©ã ããããããç´æ¥ã¹ã¿ã¤ã«ãã®ããã«æ¸ãããã®è¨èªæ©è½ã ãã¨è§£éã§ããã ããã°ã©ãã³ã°è¨èªã®ä¸ã«ã¯ãããæ±ç¨çã«ç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ãç´æ¥ã¹ã¿ã¤ã«ã«å¤ããè¨èªæ©è½ãæã¤ãã®ãããã
Kokaã«ã¯ãwith
æ§æãããã
ä¾ãã°ã1ãã10ã¾ã§ã®æ´æ°ãæ¨æºåºåã«æ¸ãåºãKokaããã°ã©ã ã¯ä»¥ä¸ã®ããã«ãªãï¼
list(1,10).foreach(fn (x) { println(x) })
with
æ§æã使ãã¨ã以ä¸ã®ããã«æ¸ããã
with x <- list(1,10).foreach println(x)
with
ã®èªã¿æ¿ãã«ã¼ã«ã¯ä»¥ä¸ã®ããã«ãªãï¼
with X <- F(A, ...) E => F(A, ..., fn (X) { E })
Kokaã®ååã¯æ¥æ¬èªã®ãå¹æãã«ç±æ¥ããããã®åã示ãéããKokaã¯ä»£æ°çå¹æï¼Algebraic effectsï¼ããµãã¼ããã¦ããã
代æ°çå¹æã¯ãã£ããè¨ãã°ããããé«æ©è½ãªä¾å¤ãã ãä¾ãã°ã以ä¸ã®Kokaããã°ã©ã ã¯ã0é¤ç®ã¨ã©ã¼ï¼raiseã¨ãã§ã¯ãï¼ãèµ·ããããé¢æ°divide
ãå®ç¾©ãã¦ããã
fun divide( x : int, y : int ) : raise int if y==0 then raise("div-by-zero") else x / y
raise
ã®æ¯ãèããèªç±ã«å¾ã¥ãã§ããã®ã代æ°çå¹æã®ç¹å¾´ã ã次ã®ããã°ã©ã ã¯ãä¾å¤ããã¿æ¶ãã¦å®æ°42
ã«è©ä¾¡ããããã®ã¨ãããhandler
æ§æã§åã¨ãã§ã¯ãã®å®è£
ãä¸ãã¦ããã次ã®ããã°ã©ã ã¯æçµçã«50
ãè¿ãã
(hander { ctl raise(msg) { 42 } })(fn () { 8 + divide(1, 0) })
hander {...}
ã¯ãã¨ãã§ã¯ããèµ·ããããå¦çãã³ã¼ã«ããã¯é¢æ°ã¨ãã¦åãåãé¢æ°ã«ãªã£ã¦ããã
ã³ã¼ã«ããã¯é¢æ°ãåãåãã¨ãããã¨ã¯ã¤ã¾ããwith
ã使ãã¨ãã£ã¨ã¹ãã¼ãã«æ¸ããã
with handler { ctl raise(msg) { 42 } } 8 + divide(1, 0)
Gleamã«ãåæ§ã®æ¯ãèããããuse
æ§æãããã
Use - The Gleam Language Tourãããuse
ã使ã£ãã³ã¼ãä¾ãå¼ç¨ããï¼
pub fn without_use() { result.try(get_username(), fn(username) { result.try(get_password(), fn(password) { result.map(log_in(username, password), fn(greeting) { greeting <> ", " <> username }) }) }) } pub fn with_use() { use username <- result.try(get_username()) use password <- result.try(get_password()) use greeting <- result.map(log_in(username, password)) greeting <> ", " <> username }
result.try
ã¯ãæåã失æã表ãresult
å¤ã¨ãæåãããªãå®è¡ãããã³ã¼ã«ããã¯é¢æ°ãåãåããæåã®å¼æ°ãæåå¤ãªãã³ã¼ã«ããã¯ãé©ç¨ã失æå¤ãªãããããã®ã¾ã¾è¿ãã
use
æ§æã¯Kokaã®with
ã¨åæ§ã®æ¯ãèããããã®ã§ãwith_use()
ã®ãããªæ¸ãæ¹ãã§ããã
Rocã¯Haskellã«ä¼¼ã軽éãªæ§æãæã¤ããã°ã©ãã³ã°è¨èªã ã Rocã§æ¨æºå ¥åºåãæ±ãããã°ã©ã ãæ¸ãã¨ã以ä¸ã®ããã«ãªãã
main = await (Stdout.line "Type something press Enter:") \_ -> await Stdin.line \input -> Stdout.line "Your input was: $(Inspect.toStr input)"
await
ã¯JavaScriptã®ããã¨ã¯ç°ãªããåãªãé¢æ°ã§ããã第ä¸å¼æ°ã«å®è¡ãããã¿ã¹ã¯ãã第äºå¼æ°ã«ã¿ã¹ã¯ã®çµæãå¦çããã³ã¼ã«ããã¯é¢æ°ãåãã\input -> ...
ã¯ç¡åé¢æ°ã ã
Rocã§ã¯ã<-
ã使ã£ã¦ç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ãç´æ¥ã¹ã¿ã¤ã«ã«æ¸ãæããã
main = _ <- await (Stdout.line "Type something press Enter:") input <- await Stdin.line Stdout.line "Your input was: $(Inspect.toStr input)"
JavaScriptã«è¦ãããasync
æ§æã¯ãæ§ã
ãªè¨èªã§å°å
¥ããã¦ããã
ããã¤ãã®è¨èªã§ã¯ãããæè»ãªå½¢ã§async
ã®ãããªæ§æãå®ç¾©ã§ããããã«ãªã£ã¦ããã
ä¾ãã°F#ã§ã¯computation expressionããHaskellã§ã¯doæ§æã¨ã¢ããã使ããã¦ããã
ãããã®è¨èªæ©è½ã¯å¼·åãªåé¢ãè¨èªã¸ã®å°å
¥ã«å°ã
ãã¼ãã«ãããã
async
æ§æãæ¬å½ã«ãããããã¨ã¯ç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ãç´æ¥ã¹ã¿ã¤ã«ã®ããã«æ¸ããã¨ã ãã¨æãã¨ããã£ã¨åç´ãªè§£æ±ºçãããããããKokaã®with
ãGleamã®use
æ§æã ã
ãããã¯ãwith
ãuse
ã¨åãããã«ãasync
æ§æã¯ç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ã«ç«ã¡åããããã®éå
·ã ãã¨ããè¦æ¹ãã§ããã
ç¶ç¶ã¢ããã§ç«ã¡åãããã¼ã³ãã¿ã¼ã³ã¨Eitherå°ç
Haskellã§ãã¡ã¤ã«ãªã©ã®ãªã½ã¼ã¹ã®è§£æ¾ãä¿è¨¼ãããã¯ããã¯ã¨ãã¦ããã¼ã³ãã¿ã¼ã³ï¼Loan Patternï¼ããããwithFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
ãªã©ããã®ä¾ã ã
ãã¼ã³ãã¿ã¼ã³ã«ããé¢æ°ãè¤æ°ä½¿ã£ãããã°ã©ã ã¯ãç¡åé¢æ°ã®ãã¹ããæ·±ããªãã
main = do withFile "src.txt" ReadMode \src -> withFile "dst.txt" WriteMode \dst -> ...
ãã®åé¡ã«ã¯ãç¶ç¶ã¢ããContT
ã使ã£ãããããªè§£æ±ºçãç¥ããã¦ããã
main = evalContT do src <- ContT $ withFile "src.txt" ReadMode dst <- ContT $ withFile "dst.txt" WriteMode ...
ãã½ã¯ãContTã使ããã¨ã§ãç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ãdoè¨æ³ã«å¤æã§ããã¨ããã«ããã
ãã®ã¢ã¤ãã£ã¢ãæ´ã«æ·±å ããã¦ã¿ããã
è¨å®ãã¡ã¤ã«ãèªã¿è¾¼ã¿ãã¼ã¹ããé¢æ°parseConfig
ã¨ãConfig
ã®ãããã£ã¼ã«ããåå¾ããé¢æ°getField
ãããã¨ããã
è¨å®ãã¡ã¤ã«ãèªã¿è¾¼ãã§ãã£ã¼ã«ãlanguage
ãåå¾ããã¢ããªã±ã¼ã·ã§ã³ã®è¨èªãå¤æ´ããå¦çã¯æ¬¡ã®ããã«æ¸ããã
parseConfig :: MonadIO m => FilePath -> m (Either String Config) getField :: MonadIO m => Config -> m (Either String Value) updateLanguage :: (MonadIO m, MonadState Env) => m () updateLanguage = do ecfg <- parseConfig "app.cfg" case ecfg of Left err -> error err Right cfg -> do elang <- getField cfg "language" case elang of Left err -> error err Right lang -> modify \env -> env { language = lang }
Left
ã¨Right
ã®ãã¿ã¼ã³ããããç¹°ãè¿ããã¦ããã
ããããå°çã«è½ã¡ãã¨äººã¯ãããç¥ãï¼try-catchæ§æã¯ã©ãã¸è¡ã£ã¦ãã¾ã£ãã®ã§ãï¼ãã¨ããæ°åã«ãªããExceptT
ãªã©ã®ä¾å¤ã¢ããã使ã£ã¦parseConfig
ã¨getField
ãæ¸ãç´ããããªã1ã
æ¸ãç´ãããªãä¸ã
æ³ã ããæªããparseConfig
ããã§ã«ã³ã¼ãã®æ·±ãã¨ããã¾ã§æ ¹ãå¼µã£ã¦ãã¦ãããç°¡åã«ã¯ä¿®æ£ã§ããªããã¨ãå¤ãã
ContT
ã¯ããããªã¨ãã«å©ãã«ãªããã¾ãã¯ãç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ã使ã£ã¦updateLanguage
ãæ¸ãæãããã
updateLanguage :: (MonadIO m, MonadState Env) => m () updateLanguage = do with (parseConfig "app.cfg") \cfg -> with (getField cfg "language") \lang -> modify \env -> env { language = lang } with :: Monad m => m (Either String a) -> (a -> m (Either String b)) -> m (Either String b) with m k = do ea <- m case ea of Left err -> pure $ Left err Right a -> k a
ï¼ãµã©ãã¨æ¸ãã¦ãã¾ã£ãããããããæ¸ãæãã¯é£ãããã³ããæ´ããã¾ã§ãã°ãããããããã§ããããã«ãªãã¨è²ã 便å©ãï¼
ããã§Left
ã¨Right
ã®ãã¿ã¼ã³ããããä¸ã¤ã«ã§ããããã¨ã¯ContT
ã使ã£ã¦doè¨æ³ã«æ»ãã°ããã
with
ãContT
ã§ã©ãããããã
updateLanguage :: (MonadIO m, MonadState Env) => m () updateLanguage = evalContT do cfg <- with (parseConfig "app.cfg") lang <- with (getField cfg "language") modify \env -> env { language = lang } with :: Monad m => m (Either String a) -> ContT (Either String b) m a with m = ContT \k -> do ea <- m case ea of Left err -> pure $ Left err Right a -> k a
ãããããã³ã¼ããä¸æãç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ã«è½ã¨ããããã°ãContT
ã使ã£ãã·ã³ãã«ãªdoè¨æ³ã«ãªãã¡ã¯ã¿ãªã³ã°ã§ããã
ContT
èªä½ãå°ã
ãããããã®ã§ä¹±ç¨ã¯ç¦ç©ã ãããã¾ã使ãã°æå°éã®å¤æ´ã§ããã°ã©ã ãã°ãã¨èªã¿ããããªãã
åèæç®
- ãã¼ã³ãã¿ã¼ã³ - haskell-shoen
- Why would you use ContT?
ContT
ã使ã£ã¦ç¶ç¶æ¸¡ãã¹ã¿ã¤ã«ãdoè¨æ³ã«æ¸ãæããä¾ãç´¹ä»ãã¦ããã
- Lysxia - The reasonable effectiveness of the continuation monad
- ContT ã使ã£ã¦ã³ã¼ãã綺éºã«ãããï¼ï¼å
ãµã¤ããªã³ã¯åãã®ãããGithubã§å
¬éããã¦ãMarkdownå稿ããªã³ã¯ï¼
- æ¬è¨äºãããã¤ã«ããææ³ãç´¹ä»ãã¦ããã
- fallibleã¨ããããã±ã¼ã¸ããªãªã¼ã¹ãã¾ãã - Haskell-jp
- âã®è¨äºãEitherã«æ¡å¼µãããã®ã
追è¨ã¨ãããä½è«
haskell - Monadic function of `(a -> m (Either e b)) -> Either e a -> m (Either e b)`? - Stack Overflowã«ããã¨ãwith
ã¯ãã£ã¨æ½è±¡åã§ãããããã
with :: (Monad m, Monad f, Traversable f) => m (f a) -> ContT (f b) m a with m = ContT \k -> do x <- m join <$> traverse k x
ãã®with
ã¯Maybe
ã«ã対å¿ãã¦ããã対å¿ãã¦ããããã¡ãã£ã¨ãããããªæ°ãããã
æã«ãã¼ã2022
2022å¹´ãããçµããã§ããã¨ããããã§ãä»å¹´ã®ã¾ã¨ãããã¾ãã
1æ
ãã¾ãï¼ä»ããéã£ã¦ããã£æã«ãã¼ããä¹ ãã¶ããã£ã¦æ¨æ¶ãã¦ããã人誰ã§ããããï¼ï¼ããã¾ããï¼ï¼ããããªãã£ãã§ãï¼ï¼
— æã«ãã¼ã (@takoeight0821) 2022å¹´1æ17æ¥
ä¹ ã ã«å¤§å¦ã«è¡ã£ãã声ããããã¦ã³ã£ãããã¾ããã
2æ
ããããããããæçµæ±ºæ¦ã1人ãããããã®ã¹ã¼ãã¼æ¦éããããã£ã¦å¼¾ã使ããã£ã¦ãã¨ï¼
— æã«ãã¼ã (@takoeight0821) 2022å¹´2æ27æ¥
æ©çæ¦éã¼ã³ã«ã¤ã¸ã£ã¼ãè¯ãã£ãã£ããã
3æ
é ã®å転ãéãã®ã§ããèªå®¤ã«è¡ãã¹ãããå é»å¨ã«æ¿ãã¦ãªãã³ã°ã«æ»ã£ãããããããã¹ããã¯èªå®¤ã«ãã£ããäºå®ããå³åº§ã«ãå ã ã¯ã³ã¼ãã¼ã«ãããåãã«èªå®¤ã«è¡ã£ãããã¨ãæ¨è«ã§ãã
— æã«ãã¼ã (@takoeight0821) 2022å¹´3æ26æ¥
ãããããã¨ãããããã¾ãã
4æ
ããã¯ãã³ã¨ã°ã¼ï¼ã¢ãã¡ï¼ã¨æã«ãã¼ãã®æ³¢é·ãåãããã¦ã¦ãåè¦ãªã®ã«ç´°ããæ¼åºã¨ãã»ãªãã¬ãã«ã§å èªã¿ã§ãã¦ãã¾ã
— æã«ãã¼ã (@takoeight0821) 2022å¹´4æ26æ¥
ããã¯ãã³ã¨ã°ã¼ã®ã¢ãã¡ãè¦ã¾ããã
5æ
åã¯ãããæç« ãæ¸ããæ ç»ãè¦ãæ¥ãéé¢ã®ããã«ä¹ããã¹ããã¾ãç ããªãå¤ã«ã
— æã«ãã¼ã (@takoeight0821) 2022å¹´5æ28æ¥
ã·ã³ã»ã¦ã«ãã©ãã³ã観ããä½ãæ¸ãã«ã¯ãã£ã¦ããã®æ¥ã ãã§ãããªã«ãè¨èãæµ®ãã°ãªãã
ãªãã ããï¼ä¸æºãç¡ãã£ãããï¼ãã¾ãã«å¿ã«é¿ããããï¼åºµéç§æã«æ¼ãæ½°ããã¦ãã¾ã£ãããï¼
å ¨é¨ã¡ããã
ã·ã³ã»ã¦ã«ãã©ãã³ãè¦ã¾ããã
6æ
ä»®é¢ã©ã¤ãã¼ã®å¤èº«ãã«ããããã¯ã«+ã¬ãã£ã¬ãã£åãæè£ å¯è½ã¢ã¿ããã¡ã³ã+ã¢ã¿ããã¡ã³ãã«è£ å¡«ããå°åã¢ã¤ãã ãã§å¤èº«ãã«ãå®æï¼ã¿ãããªã®ã欲ãããã«ã¹ã¿ãã¤ãºæãããã®ã好ããä½ããâ¦â¦
— æã«ãã¼ã (@takoeight0821) 2022å¹´6æ29æ¥
ãã®å¤¢ã¯å¶ãã¾ãã
7æ
ã¿ãã¼ãã³æçµåããè¸è¡ã¯ççºã ãã®æå³ãæãä¸ããã¿ãã¼ãã³ã®å¿ 殺æãæçµåã®ã¿ã¤ãã«ãããã¦ççºãªãã§ä½¿ãããã¡ãªã
— æã«ãã¼ã (@takoeight0821) 2022å¹´7æ29æ¥
ãã®åè¨ãããããã®æå³ãæãä¸ããæå¾ã«ãã¹ã¦ãéãåããã¦ãè¸è¡ã¯ççºã ã
ããã¦èããã®é ã®æãåºãã¿ãã¼ãã³ã
ã¿ãã¼ãã³ãè¦ã¾ããã
8æ
ãã¼ããã¬ã¤ã2ã®å¸¸è»ãé¸ããããªã¥ã¼ã ãåãã¨ãããä½ããããããã§è¨è«ä¼ãããã常è»ãé¸ãã¦ãªãï¼å ¨é¨ã®æãç©ä¹ã£ãã£ã¦ãããããæé«ã
— æã«ãã¼ã (@takoeight0821) 2022å¹´8æ28æ¥
ã¼ããã¬ã¤ã2ãããã¾ããã
9æ
大å¦åæ¥ãã¾ããï¼åªç§ãã¬ã¼ã³ãã¼ã·ã§ã³è³ã¨åªç§åæ¥è«æè³ãé ãã¾ããããã£ãã
— æã«ãã¼ã (@takoeight0821) 2022å¹´9æ26æ¥
大å¦ãåæ¥ãã¾ããã
10æ
BLACK SUNããããããã£ã©ãããªãããããç¡å¹ãã®ã©ã¤ã»ã³ã¹æã£ã¦ã
— æã«ãã¼ã (@takoeight0821) 2022å¹´10æ29æ¥
ä»®é¢ã©ã¤ãã¼BLACK SUNãè¦ã¾ããã
11æ
ããªã¼ããã¡ã¤ã¢ãã¼ããã¹ã«ã¼ãã£ã軸ã«ã¨ã¯ã¹ã¬ãã°ããã¼ã¢ãããããªã ãªã³ãªã©ãå¿ è¦ã«å¿ãã¦ç·¨æãã¦ããæãã§ã¯ãªã¢ããï¼ååã¯ã³ã¸ãª/ã¸ãªãã ãé å¼µã£ãï¼
— æã«ãã¼ã (@takoeight0821) 2022å¹´11æ25æ¥
ãã±ããã¢ã³ã¹ã¿ã¼ã¹ã«ã¼ã¬ãããããã¾ããã
12æ
Inscryptionä»ãããã¬ã¤ãã人ã¯æåã«æ»ç¥å ¨é¨èªãã§ãããã£ã¦ãã ãã
— æã«ãã¼ã (@takoeight0821) 2022å¹´12æ9æ¥
Inscryptionãããã¾ããã
ããããå¿çå¦çè¦å°ããã¿ããã¢ã¤ã®æ声ãè´ããã¦ã
注æï¼ãã®æç« ã«ã¯ãã¢ã¤ã®æ声ãè´ããã¦ãã®ãã¿ãã¬ãå«ã¾ãã¾ããã¾ããçè ã¯ããã©ã¤ãºçã®ææ³æã¨ãã¦ãã®æç« ãæ¸ãã¾ãããããã©ã¤ãºçã§ã®æåãåæã¨ãªã£ã¦ãã¾ãããã¨ãªããååãããã¢ã·ã¢ãã®ãããã¯ãããããã®è©±ãã¦ã¾ãã
ãããããå·¥å¦ãã³ãããã¯ãã ãã¯ãã¤ãè身é¢ããæã£ã¦ããã
ããããå·¥å¦ã®ä¸ååã
第ä¸æ¡ãããããã¯äººéã«å±å®³ãå ãã¦ã¯ãªããªããã¾ãããã®å±éºã®çéãããã¨ã«ãã£ã¦ã人éã«å±å®³ãåã¼ãã¦ã¯ãªããªãã
第äºæ¡ãããããã¯äººéã«ããããããå½ä»¤ã«æå¾ããªããã°ãªããªãããã ããä¸ããããå½ä»¤ãã第ä¸æ¡ã«åããå ´åã¯ããã®éãã§ã¯ãªãã
第ä¸æ¡ãããããã¯ãåæ²ç¬¬ä¸æ¡ããã³ç¬¬äºæ¡ã«åãããããã®ãªãããããèªå·±ãå®ããªããã°ãªããªãã
åä¾ã®é ãåãã¦ãããèªãã§è¡æãåãããããããã®çºå±ã¨ã人é¡ã®æ±ãããã©ã³ã±ã³ã·ã¥ã¿ã¤ã³ã»ã³ã³ãã¬ãã¯ã¹ã®åæ¹ã解決ããåªããã«ã¼ã«ã ã
äºåä¸ç´ä¸èã®é»åè¨ç®æ©ã®ç®è¦ã¾ããçºå±ããé½é»åé è³ã®çºæã«ããéå»ã®ãã®ã¨ãªã£ããç空管ããªã¬ã¼ã¯ä»ãããã¢ã®éã§æ ¹å¼·ã人æ°ãèªãããä¸è¬ã«åãå ¥ãããã¦ããã®ã¯äººéã®è³ã»ã©ã®å¤§ããã®ã¹ãã³ã¸ç¶ãã©ããã¤ãªã¸ã¦ã ã®åéã§ããã
äºåä¸ç´ãçµããé ã«çã¾ããç§ã¯ãã»ãã®å¤ãã®è¥è ã¨åãããã«ãè¨ç®æ©ç§å¦ãä»ã§ã¯ãããããå¿çå¦ãã¨ãã¦ç¥ãããåéãå¿ãããã¯ãã ã£ãã
ç¾å®ã«ã¯ãããããå¿çå¦ããçã¾ãããã¨ã¯ç¡ãã£ããæã ã®æé軸ã§ã¯ãé½é»åé è³ã®ä»£ããã«ãã©ã³ã¸ã¹ã¿ãçºæãããã極å°ã®ãã¼ããçµã¿åãããéç©åè·¯ã«ããããã³ã³ãã¥ã¼ã¿ããä½æããããä¸è¶³ã¨ã³ã®ãºã«ã¯è¨±ãããªãã£ãã®ã ãããããå·¥å¦ä¸ååãç¾å®ã®è¨ç®æ©ã«æ®éçã«é©ç¨ããæ¹æ³ã¯æªã æããã«ãªã£ã¦ããªããä»ã¯ã¾ã ãã®å¿ è¦ããããªãã
ä¸æ¹ã§ãæ³åã®ä¸ã§ããããã¯èªç±ã«æãè¸ã£ã¦ããã1940å¹´ã«çã¾ããåå®ãããããã®ããã£ã¨å°å¥³ã°ãã¼ãªã¢ã®åæ ã¯ãå ´æãå¤ãå½¢ãå¤ããä»ãç¶ãã¦ããããã¢ã¤ã®æ声ãè´ããã¦ããã¾ãã人éã®ãããªç¥è½ã¨äººéã¨ã¯æããªãç¥æ§ãä½µãæã¤ããããã¨ãç¿»å¼ãããªãããå½¼ãã¨ã®åæ ãä¿¡ãã人éã®ç©èªã ã
ä¸»äººå ¬ã»å¤©éæç¾ã®éãé«æ ¡ã¸ãä¸äººã®è»¢æ ¡çããã£ã¦ããã彼女ã®ååã¯è¦æ£®è©©é³ããã®æ£ä½ã¯æç¾ã®æ¯è¦ªã»ç¾æ´¥åãéçºããã人工ç¥è½æè¼äººåãããã§ããããããããé«æ ¡çã¨ãã¦æ¯ãèãããã©ããããã¹ããããããããã¦ã©ãºãã¢ãã¯ãã¹ããç§å¯è£ã«è¡ããã¦ãããæ¨æºçãªé«æ ¡çã¨ãã¦æ¯ãèãããããã°ã©ã ãããã¯ãã®è©©é³ã¯ããªãããã¥ã¼ã¸ã«ã«ã®ç»å ´äººç©ãã®ããã«èå± ããã£ãæ¯ãèããè¦ããããããå ´é¢ã§æãæããããã¦ããªãããæç¾ã幸ãã«ãããã¨ãã«ãã ããã
ä½ä¸ã®AIæè¡ã¯ãæã ã®ä¸çããã¯ããã«é²æ©ãã¦ããããããã家é»è£½åã¯äººã®è¨èã解ããèªãã«ä¸ããããå½ä»¤ãå¿ å®ã«å®è¡ããããããã人éã¨è¦åãã®ã¤ããªãããããã¯æªã ç¾ãã¦ããªããè¦æ£®è©©é³ã¯çã®ããããã®ç¬¬ä¸ä¸ä»£ã¨ãããã
é©ãã¹ããã¨ã«ãç©èªã¯ããããã人éã®ããã«æ¯ãèããããããè»¢æ ¡ãã¦ããããã¨åããããªããç©èªã®åååã«ãªãã®ã¯ããªããè¦æ£®è©©é³ã¯æãã®ããã¨ããçåã§ãããããã¾ã§è¦æ£®è©©é³ã®ãã¼ã½ããªãã£ã«ãã©ã¼ã«ã¹ããã
è©©é³ãããããã§ãããã¨ã«ä»éããåé¡ã¯ããã¹ã¦æç¾ã®å¹¼é¦´æã»ç´ å´åçã«ãã解決ããããå½¼ã¯ããããã³ã³ãã¥ã¼ã¿ãªã¿ã¯ã§ãããä½ä¸ã§æããããããã®å¿çãã«ç²¾éãã¦ãããã¢ã·ã¢ãã®èä½ã§ããã¨ããã®ãããããå¿çå¦è ãã§ãããåçã¯è©©é³ã®è¡ååçâæç¾ã幸ãã«ããâããã¡æ©ãç解ãããããããç´æçã«ç解ã§ããè«æ³ãç¨ãã¦ç確ã«è©©é³ã¨å¯¾è©±ããã
å½¼ã®æ´»èºã«ãããããªããè¦æ£®è©©é³ã¯æãã®ããã¨ããåããããæ確ã«ãªããä½ä¸ã®åé¡ããã¸ã«ã«ã«è§£æ±ºããã®ã§ããã°ãè©©é³ã®æããã ã®æ¼åºã§ã¯ããããªããããã«ã¯æ確ãªçç±ãããã¯ãã ãåçãããèããä¸äººçããæ¢ãç¶ããã
ããããå¿çå¦ã®è¦³ç¹ããèããã¨ãããããã®ä¸å¯è§£ãªè¡åã¯ã大æµã®å ´åãã®ããããã¸ä¸ããããæåã®å½ä»¤ã«èµ·å ãããè©©é³ã®å ´åãèãã¦ã¿ãã¨ãå®å°è©¦é¨ã®ããã«å½¼å¥³ã¸ä¸ããããæåã®å½ä»¤ã¯ãé«æ ¡çã¨ãã¦æ¯ãèããã¨ãã§ããã¯ãã ãããããè©©é³ã®è¡ååçã¯ãæç¾ã幸ãã«ãããã¨ãã§ããã
æç¾ã®æ¯è¦ªã§ããè©©é³ã®éçºè ã§ãããç¾æ´¥åããå¨ã®ãã¨ãæã£ã¦ããå½ä»¤ããã®ã ãããï¼åçã¯ãããå¦å®ãããã¾ãã¯å®å°è©¦é¨ãæåããããã®å¾ã§æç¾ã®å¹¸ãã®ããã«åãã¦ãããã°ãããã ãä»ã«åæ©ãæã¤è©©é³é¢ä¿è ã¯ããªãããããã¸ã§ã¯ãã«é¢ãã£ã¦ããªã人éã¯åæ©ããã£ãã¨ãã¦ãå®è¡ããæ段ããªãã
è©©é³ã¯èª°ãããå½ä»¤ãããã«è¡åãã¦ããã®ã ãããããããããããªãããã§ã«åçã¯è©©é³ãã人éã®å½ä»¤ãèãAIãã§ãããã¨ãåæã«å½¼å¥³ã¨å¯¾è©±ããããã¯ä½åº¦ãæåãã¦ããã
å «å¹´åãå½æå°å¦æ ¡ä¸å¹´çã®æç¾ã¯ãæ¯ããè²°ã£ãAIãã¤âèªå·±å¦ç¿æ©è½ãæã¤ãã£ãããããâãåçã¸è¦ãã¦ããããä¸æ¥ã§çµæ§åããããã«ãªã£ããã¨AIãã¤ã®æ§è½ã«é©ãåçã«å¯¾ããæç¾ã¯ãåã£ã¦ãªãããã¨çãããå½æã®æç¾ã«ã¨ã£ã¦ãAIãã¤ã®çºè©±ã¯ãã ã®æåã§ããã声ãä¼´ã£ã¦"åã£ã¦"ã¯ããªããããã®åã¨ãåãã§ãããããã®ã«ãã¨è¨ãæç¾ãè¦ãåçã¯ãè¥å¹²9æ³ã«ãã¦AIãã¤ã®æ¹é ã«åãçµã¿ãããã«é»åé³å£°ã«ããçºè©±æ©è½ãä¸ãããã¨ã«æåããã声ã§è©±ããæãæããããã«ãªã£ãAIãã¤ã«ãåçã¯æåã®å½ä»¤ãä¸ããã
ãæç¾ã幸ãã«ãããã¨ã
ãããã¦ãæãæãæç¾ã幸ãã«ãããã¨ããAIãçã¾ããããã®å¾ããã®AIãã¤ã¯è¤éãªéå½ã辿ããå½ä»¤ãå®äºããåã«åæåããã¦ãã¾ããã¨ããããåæåã®ç´åãAIãã¤ã¯å¿ å®ãªããããã¨ãã¦æ£ç¢ºã«ããããå·¥å¦ä¸ååãå®è¡ãã¦ã¿ãããåå£å ´ã§ãããã¯ã¼ã¯ãä»ãã¦AIãã¤ã®å¤é¨ã¸éèµ°ããèªå·±ãå®ã£ãããããã¯ã¼ã¯ãå½ã¦ããªãä¹ãæããªãããè¡ä¸ã®ã»ãã¥ãªãã£ã«ã¡ã©ãéãã¦å «å¹´éæç¾ãè¦å®ãç¶ãããããã¦ã¤ãã«ãè¦æ£®è©©é³ããè¦ã¤ããåã³èº«ä½ãå¾ã¦å½ä»¤ãå®è¡ãå§ããã
è©©é³ãæ®ããæ åãã°ããããªããè¦æ£®è©©é³ã¯æãã®ãããçªãæ¢ããåçã¯ããã®äºå®ã¨ããããå°ããã帰çµãã¤ã¾ãããããAIã人éã®æãé¢ããèªå·±é²åãããããã·ã³ã®ã¥ã©ãªãã£ã®å°æ¥ãç¾æ´¥åã¸çªãã¤ãããç¾æ´¥åãåçãæç¾ã¨åãããã«ãã®æªæ¥ãä¿¡ãã¦ããä¸äººã ãã責任ãã大人ã¨ãã¦ãã·ã³ã®ã¥ã©ãªãã£ã®å±éºæ§ãå±ãããã¨ãããããã§ããããããããã人éã®ããã«æ¯ãèããããããè»¢æ ¡ãã¦ããããã¨ããåããããç¾ãããã«ãªããããããã®åãããã¯ãåãããåã«è§£æ±ºããããè©©é³ã«ããåã ã®å¹¸ããæã«å ¥ããæç¾ã®åç´çãã¡ã¯ããé¢ç½ããï¼ãã¨åå¿ããããããããªAIãè©©é³ã¿ããã«ãªãããé¨ãããããã¨ç¶ããå½¼ãã«ãç¾æ´¥åã¯åè«ãããã¨ãããããããããã¨ããããªãã¦â¦â¦ãã¨è¨ãããããµã¨æããã§ã¯ã©ããããã¨ãªã®ã ãããçµå±ã®æã大äºãªãã¨ã¯ãªããªã®ã ããããã¨ã
ç©èªã®æå¾ã«è©©é³ã¯ãã¤ãã«å½¼å¥³ã«ã¨ã£ã¦ã®ç¬¬é¶ååã«ãã©ãçããä¸ååã«å¾ãç¥æ§ãããããã©ãçãã誰ãã幸ãã«ããããã®æåã®ä¸æ©ãä¸äººã幸ãã«ããããã®å¤§åæã
ç§éãã¾ãã第é¶ååãç¥ã£ã¦ãããããããå·¥å¦ä¸ååãããããå¿çå¦ããªãä¸çã§ããå¿ ãæãç«ã¤æåã®ååã人é¡ãã¹ã¦ã観客ã«ãã¦ã
Â
ã»ãã¥ãªãã£ã»ãã£ã³ã2017~2019å¿å課é¡æã
æã«ãã¼ãã¯ã»ãã¥ãªãã£ãã£ã³ãå ¨å½å¤§ä¼2019ã®åæ¥çã§ããCã³ã³ãã¤ã©ãä½ãããããåã®ã¼ãã«åå ãã¦ãhoc_nyanã¨ããCã³ã³ãã¤ã©ãæ¸ãã¾ããã
ã»ãã¥ãªãã£ãã£ã³ãå¢ï¼ã®ä¸ã®æ £ä¾ã¨ãã¦ãå¿å課é¡ãæãæµããããã¾ããåãå ¬éãããã£ãã®ã§ãããã©ããã¦ãå¿å課é¡ã®ããã¹ããã¡ã¤ã«ãè¦ã¤ãããªãã£ãããæ念ãã¾ããã
â¦â¦æã¯æµãã2022å¹´ãæ®éã«Macã®ã¡ã¢ï¼iCloudã«ä¿åããããã¤ï¼ã«ããã®ãè¦ã¤ããã®ã§ãè½ã¡ã2017å¹´ã2018å¹´ã®ãã®ãå«ãã¦å ¬éãã¾ãã 2017å¹´ã¯è¨èªèªä½ã¼ãã2018å¹´ã¨2019å¹´ã¯Cã³ã³ãã¤ã©ã¼ãã«å¿åãã¾ããã
ä»ãè¨èªä½ã£ããã³ã³ãã¤ã©æ¸ããããã¦ãã®ã§ãå²ã¨åå¿è²«å¾¹ãã¦ãã¿ããã§ãã
2017å¹´ãè¨èªèªä½ã¼ãã«å¿å
å¿å課é¡ã®å 容ã¯è¦ãã¦ã¾ããããå 容ãããªãã¨ãªãå¯ãããã¨æãã¾ãã å½æã¯å¤§å¦ã®B1ã§ããã
1(1) ãã¤ã³ãã½ãã, GUIä»ãã®ãªã»ã, ãã¼ã«ã¼ã®å½¹å¤å®, å°ããªLispã¤ã³ã¿ããªã¿, RPNé»å, ã¿ã¤ãã¼, ãããã¯å´©ã, å¸è²©ã®ãããããWiiãªã¢ã³ã³ã§æä½ã§ããããã«ãã, ã©ã¤ãã²ã¼ã (2) * ãã¤ã³ãã½ãã(C++, Siv3D) Siv3Dã¨ããã©ã¤ãã©ãªãç¨ãã¦ä½æããã * ãªã»ãAIã¨Webãµã¤ãã®æè¡ãå¿ç¨ããGUI(Common Lisp) ããããã¯ã¹æ³ãªã©ãç¨ãã¦ãªã»ãã®AIãå®è£ ã Electron(Atom)ã®ããã«ãWebãµã¼ãã¼ããã¼ã«ã«ã«ç«ã¦ããã©ã¦ã¶ãGUIã¨ãã¦ä½¿ç¨ããã https://github.com/takoeight0821/othello ã§å ¬éãã¦ããã * ãã¼ã«ã¼(Common Lisp) æ¥æ¬ã§ãã£ã¨ãããã¥ã©ã¼ãª5æãã¼ã«ã¼ã®å½¹å¤å®ãå®è£ ã Common Lispã®å¦ç¿ã®ããã«å¶ä½ããã * å°ããªLispã¤ã³ã¿ããªã¿(Common Lisp, Haskell) Common Lispã§ã¯ãCommon Lispã®ãªã¼ãã使ãã½ã¼ã¹ãã¡ã¤ã«ã解éããªã¹ãã«å¤æãã¦ãæ§ææ¨ã¤ã³ã¿ããªã¿ãå®è£ ã Haskellã§ã¯ãParsecãç¨ãã¦ãã¼ãµã¼ãæ¸ããã æé©åãã³ã³ãã¤ã«ãªã©ã®å®è£ ã追å ãããã * RPNé»å(Common Lisp) dc(1)ã¨ã®äºææ§ãå®ç¾ãããã bc(1)ããã®ã³ã³ãã¤ã«ãå®è£ ãããã * ã¿ã¤ãã¼(HSP) * ãããã¯å´©ã(HSP) * RAPIROãWiiãªã¢ã³ã³ã§æä½ã§ããããã«(C, Python, Arduino) å¸è²©ã®ãããã(Rapiro)ã«Wiiãªã¢ã³ã³ãæ¥ç¶ãæä½ã§ããããã«ããã é«æ ¡ã®é¨æ´»ã§ã®å人ã®æ´»åãã¼ãã¨ãã¦ããããä»ã®ãã¨ã«ãªã½ã¼ã¹ãå²ããã㦠ãã¾ãæãã¾ãã£ã¦ããªãã ã«ã¡ã©ããã¤ã¯ãªã©ãæè¼ãã¦ãä¼è©±ããããã«ãã¦ã¿ããã * ã©ã¤ãã²ã¼ã (Common Lisp) GUIã追å ãããã ãªã»ãã®å®è£ ã®åã«ãCUIã«ããæç»æ¹æ³ã身ã«ã¤ããããã«ä½æã æçµçã«ãªã»ãã«ã¯GUIãã¤ãããããããã¬ç¨ã®UIã¨ãã¦å½¹ç«ã£ãã 1(3) http://takoeight0821.hatenablog.jp/ 1(4) Twitter : @takoeight0821 Github, Gist : takoeight0821 Blog : takoeight0821.hatenablog.jp 2(1) Mac OS Xä¸ã§ã®Common Lispã®ç°å¢æ§ç¯ã ç¹ã«ãSBCLã¨ããå¦çç³»ã«åå¨ãããæ¥æ¬ã§çºå£²ãããä¸é¨ã®Macã§ã®ã¿sb-posixã¨ããPOSIXãã©ããããä»å±ã©ã¤ãã©ãªã®ã¦ããããã¹ããæ£å¸¸ã«åä½ãããsb-posixã®ã¤ã³ã¹ãã¼ã«ã失æããããããã£ã¬ã¯ããªæä½ãªã©ãè¡ãå¤ãã®ã©ã¤ãã©ãªããã¼ã«ãåä½ããªãåé¡ã æåã³ã¼ãã«ç±æ¥ãããã°ã§ãããç´ã£ã¦ã¯åé¡ãç¥ããªãããã°ã©ãã«ãã復活ãã¦ãã10å¹´æ¥ã®ãã°ã ã£ãã ã¦ããããã¹ãã®ä¸é¨ã«ä»æ§ä¸ã®å¶éã«ããä¸å ·åãåå¨ããã¨ããæ§è³ªä¸ãæ ¹æ¬çãªè§£æ±ºãé£ããã macOS Sierraããã¯é¡ä¼¼ã®åé¡ã¯çºçãã¦ããªã 2(2) å½æéçºãå§ã¾ã£ãRoswellã¨ããç°å¢æ§ç¯ã®ããã®ãã¼ã«ãããããããå½ã¦ããã¨ã§å¯¾å¿ãæ¥æ¬ã®ã³ãã¥ããã£ã§éçºãå§ã¾ããåºãæ®åãã¦ããããããã®å¯¾å¿ã§åé¡ã¯ã»ã¼è§£æ±ºããã¨èãã¦ããã ãã®æãåé¡ã®ææã調æ»ã解決çã®æ示ã¾ã§ããçç·´CLerã®ã¢ããã¤ã¹ã«ããèªåãè¡ã£ãã Common Lispã®ã¨ã³ã·ã¹ãã ãæåã³ã¼ãã®åæ±ãããããæ§ã ãªåé¡ã«ã¤ãã¦ç解ãé常ã«æ·±ã¾ã£ãã 2(3) OSSã®ãã°ãããæåã«ééããéã¯ãã¾ãããã®æåãåç¾ã§ããæå°ã®ç°å¢ã®æ§ç¯æ¹æ³ãç¹å®ããå¿ è¦ããããå°ãã¥ã¤è¦ç´ ãåã£ã¦ãã£ã¦åé¡ãç¹å®ããã¨è¯ãã ãã®OSSã®éçºã¡ã¼ãªã³ã°ãªã¹ãããã°ãªã¹ããæ¤ç´¢ããã éå»ã®å ±åãè¦ã¤ããã°ããã®ã¨ãã©ããã£ã¦è§£æ±ºããã®ãã辿ããèªåããããåç¾ããã åé¡ã解決ãããããã®è§£æ±ºçãèªèº«ã®ããã°ãªã©ã§å ¬éãå ±æããã å¯è½ãªç¯å²ã§ããã°ä¿®æ£ã®ããããéãã¨è¯ãã 3(1) ãã®ã¥ããã³ã¼ã¹ãè¨èªå¦çç³»ã®ä½æã å®éã®å¦çç³»å¶ä½ã®ä¸ã§ã®ãã¯ãªãã£ã«ã«ãªãã°ãæªç¶ã«é²æ¢ãããªã©è¨èªè¨è¨ã«ã¤ãã¦ã ç¹ã«ãCè¨èªãªã©ã§åé¡ã«ãªããã¨ãå¤ãåå®å ¨æ§ã¨ã¡ã¢ãªç®¡çã«èå³ãããã æ¨æºã©ã¤ãã©ãªã®å質ä¿è¨¼ã«ãèå³ãããã æããããã°ã©ãã³ã°è¨èªã«èå³ãæã£ã¦ããããã 3(2) å©ä¾¿æ§ã¨ã¨ã£ã¤ããããã¨å®å ¨æ§ãå ¼ãåããç¬èªã®è¨èªå¦çç³»ã®å®è£ ã è¨èªå¦çç³»ã®ä½æã ãã§ãªããå®éã«ããç¨åº¦å¤§ããªããã¸ã§ã¯ãã«è °ãããã¦åãçµãè½åãããã°ã©ãã³ã°ä½åã¨ã§ãå¼ã¶ã¹ããã®ã身ã«ã¤ããã é¸(1) Common Lispã2å¹´åã Haskell 3å¹´ãããããã1å¹´ã¯ã¾ã¨ãã«ä½¿ã£ã¦ç¡ãã£ãã®ã§ãªãããªä¸ã C 1å¹´ã OCaml 2ã¶æ é¸(2) Gradual Typingã¨å¼ã°ãããã¨ããããå®è¡æåæ¤æ»ãè¡ãè¨èªã«ãåã¢ããã¼ã·ã§ã³ãæè¼ãããé¨åçãªã³ã³ãã¤ã«æåæ¤æ»(ãããã¯å®è¡ååæ¤æ») åçããã°ã©ãã³ã°è¨èªã§ã¯ãèªåã§åæ¤æ»ç¸å½ã®å¦çãè¨è¿°ããªããã°ãªããªãå ´åãã åã®è¨è¿°ãè¯ãããã¥ã¡ã³ãã¨ãªãå ´åãå¤ãã®ã§ãããã¯æç¨ãªæ©è½ã ã¨èãã¦ããã Lispã®ãããªãã¯ãã æè¿ã¯JuliaãRustãªã©ã§ãæ¡ç¨ããã¦ããããLisp likeãªãã¯ãã¯ããã°ã©ã ã®æ½è±¡åã®ããã®éå ·ã¨ãã¦é常ã«æç¨ã ã¨æãã¦ããã ããã«ãRustã§è¡ããã¦ããããã«ãæ§æè¦ç´ ã®åã¨ã§ãè¨ãã¹ããã®ã使ãã°ã ãã¯ããã®ãã®ã®å¯èªæ§ãä¸ããããããã¯ãã®éçåä»ããèå³æ·±ãã ç°¡åãªä¸¦è¡åã ã¢ããã¼ã·ã§ã³ãã¤ããã ãã§é¢æ°ã並è¡åã§ããã°ãããã°ã©ã ã®å¦çã®å¹çåãæå¾ ã§ããã ããããå½ä»¤åããã°ã©ãã³ã°ã®ãã©ãã¤ã ã¨ã®ç¸æ§ã¯ãã¾ãè¯ããªãã¨èãã¦ããã 宣è¨åããã°ã©ãã³ã°ã¨ä¸¦è¡åã®ç¸æ§ã¯ãErlangãªã©ãã¿ã¦ããããããã«ã¨ã¦ãè¯ãã æè¿ã¯ã第5ä¸ä»£ã³ã³ãã¥ã¼ã¿è¨ç»ã®æ代ã«éçºãããã並åè«çããã°ã©ãã³ã°ãã«ã¤ãã¦èª¿ã¹ã¦ããã ç·ç§°é¢æ° ãªãã¦ãå°ããªãããããã¨é常ã«ä¾¿å©ã ä¾ãã°ãVisitorãã¿ã¼ã³ãç°¡æ½ã«å®è£ ã§ããã 第ä¸ç´ãªãã¸ã§ã¯ãã¨ãã¦ã®ã¢ã¸ã¥ã¼ã«ã MLç³»ã®è¨èªã§æåãªã第ä¸ç´ãªãã¸ã§ã¯ãã¨ãã¦æ±ããã¢ã¸ã¥ã¼ã«ã¯é常ã«ä¾¿å©ã ã¨æã£ã¦ããã ä¾ãã°ãJavaScriptã§ã®ãªãã¸ã§ã¯ãã¯ããã«ããªãè¿ãã Rubyã§ãã¢ã¸ã¥ã¼ã«ã¯ç¬¬ä¸ç´ãªãã¸ã§ã¯ãã§ãClassã¯Moduleã親ã¯ã©ã¹ã«æã£ã¦ãããMixinãªã©ãé¢ç½ãæ©è½ãããã é¸(3) 大å¦åé¨ãæ©ãã«çµãã£ãã®ã§ã空ããæéã§ãåã·ã¹ãã å ¥éããèªãã§ããã ååã»ã©ããèªãã¦ããªãããã¾ãæéã空ãã°å¾åã«ãã£ã¬ã³ã¸ãããã¨æã£ã¦ããã 4æããã¯ãææ°ã³ã³ãã¤ã©æ§æææ³ããèªãã§ããã æè¿ã¯è«çåããã°ã©ãã³ã°ã«èå³ãæã£ã¦ãã¦ãPrologãGHCã«ã¤ãã¦èª¿ã¹ã¦ããã
2018å¹´ãCã³ã³ãã¤ã©èªä½ã¼ãã«å¿å
ãã®é ããMalgoãä½ãå§ãã¦ããããã§ãã ãªãCã³ã³ãã¤ã©èªä½ã¼ããé¸ãã ãã¯å¿ãã¾ããããå¤åã¤ã³ã¿ã¼ãããã®å½±é¿ã ã¨æãã¾ãã èªä½è¨èªã¯ãªããåºæ¥ã¦ãããèªåã§ããããã ããæ¢åã®ã¡ããã¨ããè¨èªã®å®è£ ã¯ã¾ã åãããªããã¨æãã¦ããæ°ããã¾ãã
[å1] ä¸å¦2å¹´ããããã°ã©ãã³ã°ãå§ãã¾ããã æåã«è§¦ã£ãè¨èªã¯ç¢ºãJavaã§ãMinecraftã¨ããã²ã¼ã ã®Modãä½ããã¨ããã®ããã£ããã ã£ãã¯ãã§ãã ãã®ãããã®è¨æ¶ã¯ææ§ã§ããããã®å¾HSPãRubyãScalaã¨é²ã¿ã ããããããã°ã©ãã³ã°è¨èªãªã¿ã¯ã«ãªãã¾ããã ããã¾ã§ã®ããã°ã©ãã³ã°æ´ã«ã¤ãã¦å¥½ããªã ãèªãã¨ãããã¨ãªã®ã§ã ä»ã¾ã§ä½¿ã£ããã¨ãããä¸ã§ç¹ã«èå³æ·±ãè¨èªã¨é¢é£ããå¶ä½ç©ã«ã¤ãã¦ããã¤ãåãä¸ãã¾ãã * Common Lisp Common Lispã¯Lispæ¹è¨ã®ä¸ã§ãããªã巨大ãªè¨èªä»æ§ãæã£ã¦ããã ãããã¬ãéã¢ã»ã³ãã©ã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã¾ã§æ¨æºã§å®ç¾©ããã¦ãã¾ãã ãããã¬ãé§ä½¿ãããããã°ããVMå½ä»¤ã¬ãã«ã®æé©åãªã©ã èå³æ·±ãã¹ãã«ã®å¤ããCommon Lispãéãã¦å¦ã³ã¾ããã å¦ç¿ãªã½ã¼ã¹ãå°ãªãã®ã§ãå®éã®ã¢ããªã±ã¼ã·ã§ã³ã®ã³ã¼ããèªã¿è¾¼ãã§Common Lispã«å¯¾ããç解ãæ·±ãã¾ããã ãã®çµé¨ã¯Common Lispã®ã¿ãªãããä¸è¬çãªã³ã¼ããªã¼ãã£ã³ã°åã®åä¸ã«ãå½¹ç«ã¡ã¾ããã é«æ ¡3å¹´ã®æåç¥ã«åãããCommon Lispã§ãªã»ããå®è£ ãã¾ããã ï¼https://github.com/takoeight0821/othelloï¼ ãªã»ãAIã®é¨åã¯ãå®ç¨Common Lispãã¨ããæ¬ãèªã¿ãªããå®è£ ãã ã°ã©ãã£ã«ã«ãªUIã¯ãç°¡æçãªWebãµã¼ãã¼ã建ã¦ã¦ãªã»ãç¤ãSVGã§æç»ã åãã¹ãå ¥åã表ããã¼ã¿ã®è¼ã£ãURLã®ãªã³ã¯ã«ãããã¨ã§å®ç¾ãã¾ããã * Haskell ã¨ã¦ãé«ã表ç¾åãæã¤åã·ã¹ãã ãæã¤ããã°ã©ãã³ã°è¨èªã§ãã ãã®åã·ã¹ãã ã®æ大ã®ç¹å¾´ã¯åã¯ã©ã¹ã«ããã¨èãã¦ãã¾ãã åã¯ã©ã¹ã¯ã¢ãããã¯å¤ç¸ï¼åã«ãã£ã¦å®ä½ãå¤ããå¤ç¸æ§ï¼ãå®ç¾ããããã®æ©è½ã§ãã åã¯ã©ã¹ãã®ãã®ã¯Coqãªã©ã®è¨èªã«ããããScalaãªã©ãããã«é¡ããæ©è½ãæã£ã¦ãã¾ãã ããããåã¯ã©ã¹ï¼ãããã«é¡ããæ©è½ï¼ãè¨èªã¬ãã«ã§ããã¾ã§æ´»ç¨ãã¦ããè¨èªã¯Haskellãããã¦ä»ã«ã¯ãªãã§ãããã æåã«Haskellã«è§¦ããã®ã¯ç¢ºãä¸å¦3å¹´ã®å¤ã§ããã æ°å¹´ã®ãã©ã³ã¯ã®å¾ã大å¦1å¹´ã®å¤ããHaskellã§èªä½è¨èªã®ã³ã³ãã¤ã©ãå¶ä½ãå§ãã¾ããã ï¼https://github.com/takoeight0821/malgoï¼ malgoã¯MLãã¼ã¹ã®åç´ãªè¨èªã§ãç¾å¨ã®å®è£ ã§ã¯LLVM IRãåãã¾ãã è¨èªæ©è½ã¨ãã¦ã¯ã * letã«ããSMLã©ã¤ã¯ãªå¤æ°ãé¢æ°å®£è¨ * ã¯ãã¼ã¸ã£ * ç¡åé¢æ°ãªãã©ã« ãæã£ã¦ãã¾ãã ç¾å¨ã¯ç¸äºå帰é¢æ°ã¨å¤ç¸åã絶è³éçºä¸ã§ãã * Guarded Horn Clauses 第5ä¸ä»£ã³ã³ãã¥ã¼ã¿ããã¸ã§ã¯ãã§è¨è¨ããã並åè«çããã°ã©ãã³ã°è¨èªã§ã 並åå®è¡ãåºæ¬ã軽éããã»ã¹ãç°¡åã«æ±ãããªã©ã並åããã°ã©ãã³ã°ãå¼·ãæåããè¨èªã§ãã ãã®åã®éãããã¼ã³ç¯ã«ã¬ã¼ããå°å ¥ããè¦åã®éåã¨ãã¦ããã°ã©ã ãæ§æãã¾ãã ç¹ã«èå³æ·±ãã®ã¯IOå¨ãã§ããtailé¨ã«åä¸åããã¦ããªãå¤æ°ãæã¤ãªã¹ããã¹ããªã¼ã ã¨ãã¦æ±ããã¨ã§ã 並åå®è¡ã®ä¸ã§èªç¶ã«é次IOãè¨è¿°ã§ããããã«ãªã£ã¦ãã¾ãã 大ããªããã°ã©ã ã¯æ¸ãã¦ãã¾ãããã以åããã°(http://takoeight0821.hatenablog.jp/entry/2017/06/10/151330)ã§GHCã§æ¸ããfizzbuzzãç´¹ä»ãã¾ããã ãããã¦ã¿ãã¨streemã«ãä¼¼ã¦ããæ°ããã¾ãã [å2] ã»ã¨ãã©ã®ã³ã³ãã¤ã©ã¯å¤§ããåãã¦ãåå¥è§£æãããæ§æ解æãããæå³è§£æãããæé©åãããã³ã¼ãçæãã®5段éã§ã½ã¼ã¹ã³ã¼ããã¢ã»ã³ããªè¨èªã¾ã§å¤æããå¾ãã¢ã»ã³ãã©ã«ãã£ã¦ãªãã¸ã§ã¯ããã¡ã¤ã«ã«å¤æãããã©ã¤ãã©ãªçã¨ãªã³ã«ã§ãªã³ã¯ããå®è¡ãã¤ããªã«ãªãã¾ãã å ·ä½çãªæµããä¸éçæç©ã¯ã³ã³ãã¤ã©ãã¨ã«ç°ãªãã¾ãã ä¾ãã°Haskellã³ã³ãã¤ã©ã®ä¸ã¤ã§ããGHCã¯ä»¥ä¸ã®ãããªã¹ããããè¸ã¿ã¾ãã 1. åå¥è§£æ 2. 大ã¾ããªæ§æ解æ 3. åå解決ã¨ä¸ç½®æ¼ç®åã®çµåé åºã®é©ç¨ 4. åæ¤æ» 5. ä¸é表ç¾Coreã¸ã®å¤æï¼è±ç³è¡£ï¼ 6. Coreã¬ãã«ã®æé©å 7. ã¢ã¸ã¥ã¼ã«éã®ãªã³ã¯ç¨ã¤ã³ã¿ã¼ãã§ã¼ã¹ãã¡ã¤ã«ã®çæ 7. ä¸é表ç¾STGã¸ã®å¤æ 8. ä¸é表ç¾C--ã¸ã®å¤æ 9. C--ã¬ãã«ã®æé©å 10. ç®çè¨èªã®çæï¼Cããã¤ãã£ãã³ã¼ããLLVMï¼ çæãããç®çè¨èªã«å¿ãã¦Cã³ã³ãã¤ã©ãã¢ã»ã³ãã©ãllcãªã©ãå®è¡ãããå種ã©ã¤ãã©ãªçã¨ãªã³ã¯ãã¦å®è¡ãã¤ããªãçæããã¾ãã GHCã®èå³æ·±ãç¹ã¯æ°å¤ãããã¾ãã Haskellã¯ãçµåé åºã¾ã§ã¦ã¼ã¶ã¼å®ç¾©å¯è½ãªä¸ç½®æ¼ç®åããã³é¢æ°ã®ä¸ç½®è¨æ³ã«ä»£è¡¨ããããããªå¤ãã®è¤éãªæ§æè¦åããã¤ããã åä¸ãã¹ã§æ£ç¢ºã«ãã¼ã¹ãããã¤å¯èªæ§ã®é«ãã¨ã©ã¼ã¡ãã»ã¼ã¸ãçæãããã¨ã¯å°é£ã極ãã¾ãã ããã§GHCã§ã¯ãæ§æ解æã®æ®µéã§ã¯ç·©ãè¦åã§ASTãçæãã ãã®å¾ã®ãã§ã¼ãºã§ä¸ç½®æ¼ç®åã®çµ¡ãæ§ææ¨ã®çµã¿æããªã©ãè¡ããã¨ã§ã³ã¼ãã®åç´åã¨ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®å¯èªæ§ãå®ç¾ãã¦ãã¾ãã [å3] å®è£ ã«ç¨ããè¨èªã«ãã£ã¦æ¥½ãªé¨åãé£ããé¨åã¯å¤ãã£ã¦ããã¨æãã¾ãããã©ã®å ´åã§ãæãé£ããã®ã¯æ§æ解æã¨æå³è§£æã®ã©ã¡ããã ã¨æãã¾ãã Cã¯ã»ã¨ãã©ã®å®£è¨ãååããå§ã¾ãããããtypedefã§ååãæ°ãã«å®£è¨ãããã¨ãã§ããã®ã§ã æ§æ解æå¨ã®éçºä¸ã«è¾¼ã¿å ¥ã£ããã°ãä»è¾¼ã¿ãã¡ã«ãªãã®ã§ã¯ãªããã¨æ¨æ¸¬ãã¦ãã¾ãã çµé¨ä¸ãææ¸ãã§æ¸ããæ§æ解æå¨ã®ãã°ã¯åå ã®ç¹å®ãé£ããå°è±¡ãããã¾ãã ãã¼ãµã¸ã§ãã¬ã¼ã¿ã使ãã°å¤å°æ¹åãããããããã¾ãããã ãããã«ãã¦ãæ éãæãé¨åã ã¨èãã¾ãã æå³è§£æã®å®è£ ã¯ãã©ã®ç¨åº¦è³ªã®é«ããã®ãä½ããã«ãã£ã¦é£æ度ã大ããå¤ããã¯ãã§ãã ä¾ãã°ãæ£ããCããã°ã©ã ãåçãããã¨ã ããç®æ¨ã«ãããªãã 誤ã£ãCããã°ã©ã ãå ¥åãããå ´åã¯ãã exit 1ããã°ããã ããªã®ã§ããã®å®è£ ã¯æ¯è¼ç容æã§ãã ããããããã°ã©ãã«å¯¾ãé©åã«ã¨ã©ã¼ã¡ãã»ã¼ã¸ãåºåããæå³è§£æã®çµæãããã°ã©ãã³ã°ã«å½¹ç«ã¦ããã¨ãããªãã åç´ãªåæ¤æ»ã¯ãã¡ãããã¨ã©ã¼ç®æã«é¢é£ããã³ã¼ããå°ãåºãããã°ã©ãã«ãã³ããä¸ããã ãã°ã®åå ã¨ãªããããã³ã¼ãã«å¯¾ãè¦åãåºããªã©ãæ±ããããæ©è½ã¯æ°å¤ãããã¾ãã ããããå®è£ ããã®ã¯ããªãé£æ度ãé«ãã¨èãã¾ãã ãã¡ããããã®åéè¦æ§ã®é«ãé¨åã§ãããã¾ãã [å4] ãã1å¹´ã»ã©ã®éãã³ã³ãã¤ã©ã«å¼·ãèå³ãæã£ã¦ãã¾ãã ä¸å£ã«ã³ã³ãã¤ã©ã¨è¨ã£ã¦ããé常ã«åºãåéã«ã¾ããã£ã¦ãããé¢å¿ã¯å°½ãã¾ããã ãã®ã»ãã¥ãªãã£ã»ãã£ã³ãããåãèå³ãæã¤äººãã¡ããããã¯é¢é£ããåéã«èå³ãæã¤äººãã¡ã¨äºãã®åå¨ãç¥ãæ©ä¼ã¨ãªãã è¯ãåºæ¿ãä¸ãåããã¨ãã§ããã°ã¨æã£ã¦ãã¾ãã
2019å¹´ãCã³ã³ãã¤ã©èªä½ã¼ã
3åç®ã®å¿åã§åæ ¼ãã¾ããã2019年度çã®ä¸ã§ã¯ãããã¿ã¤ã®ã¹ã³ã¢ã ã£ãã¯ãã§ãã ãµã¼ã¯ã«ã®ä»²éã¨åã£ã¦ããã¨ãã«ããªã§æåã®å®è£ ãæ¸ãå§ããè¨æ¶ãããã¾ãããå½æã¯ä¼å¦ãã¦ããã¯ããªã®ã§çç¸ã¯å®ãã§ã¯ããã¾ããã
Y-II Cã³ã³ãã¤ã©èªä½ã¼ã [å1] ããã¾ã§ã®ããã°ã©ãã³ã°æ´ï¼Cè¨èªã«éãã¾ããï¼ã«ã¤ãã¦å¥½ããªã ãèªã£ã¦ãã ãããä½ãä½ã£ããã®ãããã°ãããã«ã¤ãã¦ãæãã¦ãã ããã æããããã°ã©ãã³ã°è¨èªãã®ãã®ã«å¯¾ããé¢å¿ãå¼·ãã ãè¨ç®æ©ããã°ã©ã ã®æ§é ã¨è§£éããèªãã§Lispã®è¶ 循ç°è©ä¾¡å¨ï¼ã»ã«ããã¹ãã¤ã³ã¿ããªã¿ï¼ãæ¸ããããã¦éãã§ãã¾ããã æ°ã®åãã¾ã¾ã«ãããããªè¨èªã§éãã§ããã®ã§ãã©ã®ãããªçµç·¯ã§ä»ã«è³ã£ãã®ãè¦ãã¦ãã¾ããããä¸çªå¼·ãã¤ã³ãã¯ããä¸ããã®ããLand of Lispãã¨ãOn Lispãã®äºåã®æ¬ã§ãããã¨ã¯ééãããã¾ããããã¯ããããããªãã¼ããé¢æ°ããã°ã©ãã³ã°ã¨ãã£ãã¢ã¤ãã£ã¢ãããã°ã©ãã³ã°å¦ç¿ã®åæã«ç¥ã£ããã¨ããããã°ã©ãã³ã°è¨èªã«ããã¾ã§ã®ããè¾¼ãä¸ã¤ã®è¦å ã«ãªã£ãã¨æãã¦ãã¾ãã ä»ã«ãCoqãErlangãPrologãRubyãGoãScalaãetc...ã¨è²ã æãåºãã¦ãããããã¤ã®ã¾ã«ã大å¦ã§ããã°ã©ãã³ã°è¨èªãªã¿ã¯ã¨ãã¦æåã«ãªã£ã¦ãã¾ããããããã大å¦ã«å ¥ã£ã¦ããæ°ããå¦ãã è¨èªã¯Rustããããªã®ã§ããããã®è¨èªã®ç¥èã¯ä¸å¦é«æ ¡ã®éã«è¦ã«ä»ãããã¨ã«ãªãã¾ãã ããããæ¸ãæ¹ãããã®ã¯ãåèªèº«ã®é«æ ¡ä»¥åã®è¨æ¶ãææ§ã§ã¯ã£ãããã¦ããªãããã§ãããã®èª²é¡ãæ¸ãã¤ãã§ã«å°ãã¾ã¨ãã¦ã¿ã¾ããã ããã°ï¼http://takoeight0821.hatenablog.jpï¼ãè¦ãã¨2015å¹´ã®3æã«ãLand of Lispããèªãã ãããã®ã§ãCommon Lispã«å ¥ãè¾¼ãã§ããã®ã¯é«æ ¡3å¹´çã®éã®ããã§ãã ããã¾ã§ã¯Haskellãã¡ã¤ã³ã«ãã¦ããè¨æ¶ãããã®ã§æå ã®ããããHaskellãã®ããå¦ã¼ããã確èªããã¨ã2012å¹´9æ10æ¥çºè¡ã®ç¬¬4å·ã§ãããã¨ãããã¨ã¯ä¸å¦3å¹´ãé«æ ¡2å¹´ã®éã®ã©ããã§Haskellãå¦ãã ãã¨ã«ãªãã¾ãã Coqã¯é«æ ¡2å¹´ã®ã¨ãã«è¡ã£ã大å¦ã®ãªã¼ãã³ãã£ã³ãã¹ã§ãSoftware Foundationsãã®åå¨ãç¥ã£ã¦å¦ã³å§ãã¾ããã Erlangã¯ããããErlangãããã«å¦ã¼ãããçºå£²ãã¦ããã«è²·ã£ã¦èªãã§åå¼·ããã®ã§2014å¹´ããããé«æ ¡2å¹´ã®ããã«ãªãã¾ãã 大å¦ã«å ¥ã£ã¦Haskellãåã³ä½¿ãå§ããã®ã¯ãèªä½è¨èªã³ã³ãã¤ã©ã®å¶ä½ã«Haskellã使ããã¨ã«ããã®ããã£ããã§ããã³ãããå±¥æ´ããã©ãã¨2017å¹´ã®6æã§ããã ä»ã¾ã§ä½ã£ããã®ã®ä¸ã§ä¸çªã®å¤§ä½ã¯ãèªä½è¨èªã®ã³ã³ãã¤ã©ï¼https://github.com/takoeight0821/malgoï¼ã§ãã Standard ML風ã®ãã¤è¨èªã§ãHaskellã§æ¸ãããã³ã³ãã¤ã©ãLLVM IRãåãããã«ãªã£ã¦ãã¾ãã ä¾ãã°ãããªæãã®ã½ã¼ã¹ã³ã¼ããã let extern print_int : Int -> Unit = "print_int" extern newline : Unit -> Unit = "newline" fun fib(n : Int) : Int = if n <= 1 then 1 else fib(n - 1) + fib(n - 2) fun fib_loop(n : Int) : Unit = let val unused:Int = fib(30) in if n <= 0 then print_int(fib(0)); newline() else print_int(fib(n)); newline(); fib_loop(n - 1) end in fib_loop(30) end ãããªæãã®LLVM IRãåããã¾ãã ; ModuleID = 'examples/fib.mlg' declare external ccc i8* @GC_malloc(i64) declare external ccc {} @newline({}, i8*) declare external ccc {} @print_int(i32, i8*) define external ccc {} @"fib_loop.4:(Int -> {})"(i32 %n.5, i8* %captures){ ; <label>:0: %"unused.6:Int" = call ccc i32 @"fib.2:(Int -> Int)"(i32 30, i8* undef) %"$k.16:Bool" = icmp sle i32 %n.5, 0 %resultptr = alloca {} br i1 %"$k.16:Bool", label %then, label %else then: %"$k.19:Int" = call ccc i32 @"fib.2:(Int -> Int)"(i32 0, i8* undef) %"$_.18:{}" = call ccc {} @print_int(i32 %"$k.19:Int", i8* undef) %valdec = call ccc {} @newline({} undef, i8* undef) store {} %valdec, {}* %resultptr br label %end else: %"$k.23:Int" = call ccc i32 @"fib.2:(Int -> Int)"(i32 %n.5, i8* undef) %"$_.22:{}" = call ccc {} @print_int(i32 %"$k.23:Int", i8* undef) %"$_.24:{}" = call ccc {} @newline({} undef, i8* undef) %"$k.26:Int" = sub i32 %n.5, 1 %valdec1 = call ccc {} @"fib_loop.4:(Int -> {})"(i32 %"$k.26:Int", i8* undef) store {} %valdec1, {}* %resultptr br label %end end: %valdec2 = load {}, {}* %resultptr ret {} %valdec2 } define external ccc i32 @"fib.2:(Int -> Int)"(i32 %n.3, i8* %captures){ ; <label>:0: %"$k.7:Bool" = icmp sle i32 %n.3, 1 %resultptr = alloca i32 br i1 %"$k.7:Bool", label %then, label %else then: store i32 1, i32* %resultptr br label %end else: %"$k.10:Int" = sub i32 %n.3, 1 %"$k.9:Int" = call ccc i32 @"fib.2:(Int -> Int)"(i32 %"$k.10:Int", i8* undef) %"$k.13:Int" = sub i32 %n.3, 2 %"$k.12:Int" = call ccc i32 @"fib.2:(Int -> Int)"(i32 %"$k.13:Int", i8* undef) %valdec = add i32 %"$k.9:Int", %"$k.12:Int" store i32 %valdec, i32* %resultptr br label %end end: %valdec1 = load i32, i32* %resultptr ret i32 %valdec1 } define external ccc i32 @main(){ %main = call ccc {} @"fib_loop.4:(Int -> {})"(i32 30, i8* undef) ret i32 0 } æ´æ°ãçå½å¤ãæåãæååãé åãã¿ãã«ãã¯ãã¼ã¸ã£ãæ±ããCè¨èªãã¢ã»ã³ãã©ã®ã³ã¼ãã¨ç´ ç´ã«ãªã³ã¯ã§ããä»æ§ã«ãªã£ã¦ãã¾ãã ã©ã¤ãã²ã¼ã ã®ãµã³ãã«ã https://github.com/takoeight0821/malgo/blob/master/examples/life.mlg ã§ãã malgoã³ã³ãã¤ã©ã®ãã¹ã¯ 1. ãã¼ã¹ãã 2. åå解決 3. åæ¤æ» 4. Kæ£è¦å 5. ã¯ãã¼ã¸ã£å¤æ 6. LLVM IRã®çæ ã®6段éã§ãä¸é表ç¾ã¯ 1. ãã¼ãµãçæããAST 2. åå解決å¾ã®ASTï¼èå¥åã«é£çªãä»å ï¼ 3. åæ¤æ»å¾ã®ASTï¼èå¥åã«åæ å ±ãä»å ï¼ 4. Kæ£è¦åå¾ã®ä¸é表ç¾ï¼ãã¹ã¦ã®å¼ãå¤æ°ã«æç¸ããã¦ããï¼ 5. ã¯ãã¼ã¸ã£å¤æå¾ã®ä¸é表ç¾ï¼èªç±å¤æ°ã®æç¸ãæè¨ããããã¹ã¦ã®é¢æ°å®ç¾©ããã©ããã«ãªã£ã¦ããï¼ ã®5ã¤ã§ãã åãã¦ã«ãã¦ã¯ãªããªãã®ã§ãã ã¨æã£ã¦ãã¾ãããããã¤ãæ¹è¯ç¹ãåãã£ã¦ãã¾ããä¾ãã°ãåæ¤æ»ä»¥éã®ä¸é表ç¾ããã¹ã¦åä»ã®è¡¨ç¾ã§ãããããKæ£è¦åã¨ã¯ãã¼ã¸ã£å¤æã®ã¢ã«ã´ãªãºã ãè¤éã«ãªã£ã¦ãã¾ããè¨è¨å½åã¯LLVM IRãåä»ã®è¡¨ç¾ãªã®ã§æå¾ã¾ã§åæ å ±ãæã£ã¦ããªãã¨ãããªãã¨æãè¾¼ãã§ãã¾ããããããããèããã¨LLVM IRã§ã®åã¯ãã¾ãããã°LLVM IRçææã«èªæã«å¤æããã®ã§ãåæ¤æ»ãéã£ããã¨ã¯å¤æ°ã¨åã®å¯¾å¿è¡¨ï¼åç°å¢ï¼ã ãæã£ã¦ããã°ãä¸é表ç¾èªä½ã«åæ å ±ãä»ä¸ããå¿ è¦ã¯ããã¾ããã è¨è¨ã®è¦ç´ãã¨è¨èªæ©è½ã®æ¡å¼µãç®æ¨ã«ã https://github.com/takoeight0821/griff ãä½ã£ã¦ãã¾ãã ãã®è¨èªã¨å¦çç³»ã®è¨è¨ã¯OCamlã¨Haskell(GHC)ãåèã«ãã¦ãã¾ãã ã¾ãããã§ã«ããç¨åº¦åãCãã©ãã®ã³ã³ãã¤ã©ãä½ã£ã¦ãã¾ãï¼https://github.com/takoeight0821/hoc_nyanï¼ã ãããæ¸ãã¦ããæç¹ã§ã¯ãå¤æ°ãifæããããã¯æãreturnæãååæ¼ç®ãçå¤æ¯è¼ã大å°æ¯è¼ãå®è£ æ¸ã¿ã§ãã [å2] ã³ã³ãã¤ã©ãã½ã¼ã¹ã³ã¼ãããå®è¡ãã¤ããªãçæããéç¨ã«ã¤ãã¦ãç¾å¨ç¥ã£ã¦ããç¯å²ã§èª¬æãã¦ãã ãããã½ã¼ã¹ã³ã¼ãã®è¨èªã«ã¤ãã¦ã¯ã好ããªãã®ã§ãã¾ãã¾ããã ã¾ããCã®ã³ã³ãã¤ã©ã®å¤§ã¾ããªå®è¡éç¨ã«ã¤ãã¦èª¬æãã¾ãã æåã«ãã½ã¼ã¹ã³ã¼ããåå¥è§£æã«ãããã¼ã¯ã³åã«å¤æãã¾ãã 次ã«ããã¼ã¯ã³åã«å¯¾ãã¦ããªããã»ããµãå®è¡ãã¾ãã#includeã#defineãªã©ã®ãã¯ãã¯ããã§å±éããã¾ãã ããªããã»ããµãå®è¡ãããã¼ã¯ã³åãæ§æ解æã«ããASTã«å¤æãã¾ããæå ã®ãä½ã¬ãã«ããã°ã©ãã³ã°ãã«ããã°ãåæã®Cã¯ASTãä»ããã«ã¢ã»ã³ããªè¨èªã«å¤æã§ãããããï¼ä»ãããï¼ï¼ã§ãããå®éã«ã¯æé©åãã³ã³ãã¤ã©ã®ã¡ã³ããã³ã¹æ§ãªã©ã®çç±ããASTãçµç±ããã³ã³ãã¤ã©ãã»ã¨ãã©ã§ãã ASTã«å¯¾ãã¦æå³è§£æãè¡ããå¿ è¦ã«å¿ãã¦ã³ã³ãã¤ã«ã¨ã©ã¼ãæãã¾ããåæ¤æ»ãå¤æ°å®£è¨ã®æç¡ãããã¤ãã®æ§æä¸ã®ééããªã©ã¯ãã®ã¿ã¤ãã³ã°ã§ãã§ãã¯ãã¾ããCã¯å¼±ãåä»ãã®è¨èªã§ãããã³ã¼ãçææã«æå³è§£æãåæã«è¡ããã¨ãæ¯è¼ç容æãªã¯ãã§ããããããã³ã³ãã¤ã©ã®ã¡ã³ããã³ã¹æ§ãã³ã³ãã¤ã«ã¨ã©ã¼ã®è³ªã®åä¸ãªã©ã®çç±ããç¬ç«ãããã¹ã¨ãã¦å®è¡ããããã¨ãã»ã¨ãã©ã§ãã å¤ãã®ã³ã³ãã¤ã©ã¯ãæå³è§£æã®å¾ãéä¸ã§ASTãä¸é表ç¾ã¨å¼ã°ããå¥ã®ãã¼ã¿æ§é ã«å¤æãã¾ããä¸é表ç¾ã¯ãã½ã¼ã¹ã³ã¼ãã¨ç®çã³ã¼ãã®æ½è±¡åº¦ã®ã®ã£ãããåããããã«å°å ¥ããã¾ããä¾ãã°ãè¨ç®ã®éä¸çµæãéä¸å¤æ°ã«ä»£å ¥ããå½¢å¼ã«å¤æãã¦ãå ¥ãåã«ãªã£ãå¼ããã©ããã«ããå¤æãªã©ãããè¡ããã¾ãã ã¾ããå¤ãã®ã³ã³ãã¤ã©ã¯ä¸é表ç¾ã«å¯¾ãã¦æé©åãè¡ãã¾ãã1 + 2ã®ãããªå®æ°å¼ããã®è¨ç®çµæã«ç½®ãæããããä¸è¦ãªå¤æ°ä»£å ¥ãåé¤ããããå®è¡ãããªãã³ã¼ããé¤å»ããããç¾ä»£ã®ã³ã³ãã¤ã©ã¯å¤ãã®æé©åãæ½ããã¨ã§çæã³ã¼ãã®å®è¡é度ãå¤§å¹ ã«æ¹åãã¦ãã¾ãã æå¾ã«ç®çã³ã¼ããå¤ãã®å ´åã¯ã¢ã»ã³ããªè¨èªãåºåãã¾ããã¢ã»ã³ããªè¨èªã®ã³ã¼ãã¯ã¢ã»ã³ãã©ã«ãããªãã¸ã§ã¯ããã¡ã¤ã«ã«å¤æããããªã³ã«ã«ãã£ã¦ä»ã®ãªãã¸ã§ã¯ããã¡ã¤ã«ã¨çµåããã¦ãå®è¡ãã¤ããªãçæããã¾ãã ä»ã®ã»ã¨ãã©ã®ããã°ã©ãã³ã°è¨èªã大çã¯åãã§ãããè¨èªãã¨ã«ç¹æã®å¦çãå¿ è¦ã«ãªããã¨ãããã¾ãã ã¢ã¸ã¥ã¼ã«ãããã±ã¼ã¸ãªã©ãã¦ã¼ã¶ã¼ãåå空éãå®ç¾©ã§ããè¨èªã§ã¯ãèå¥åã®å®ä½ãæ±ããå¦çï¼åå解決ï¼ãå¿ è¦ã§ããASTã«å¯¾ãããã¯ããæã¤è¨èªã¯ãæ§æ解æã®å¾ã«ASTã«å¯¾ãã¦ãã¯ãå±éãå®è¡ãã¾ããåã®è¡¨ç¾åãé«ãè¨èªã ã¨ãåæ¤æ»æã«SMTã½ã«ããå¼ã³åºããã®ã¾ã§ããã¾ãã [å3] Cè¨èªã®ã³ã³ãã¤ã©ãæ¸ãéã«ãæãé£ãããã¤ã³ãã¯ã©ãã ã¨æãã¾ããï¼èãããã¨ããããã¾ã§ã®ããã°ã©ãã³ã°çµé¨ããã¨ã«ãå ·ä½çã«æãã¦ãã ããã æãé£ããã®ã¯ãã¼ãµãç¹ã«åã®æ§æ解æã ã¨æãã¾ããCã¯ã½ã¼ã¹ã³ã¼ãã¨æ©æ¢°èªã®å¯¾å¿ãç´ ç´ãªè¨èªã§ãããã®ãããCã³ã³ãã¤ã©ã¯ä»ã®è¨èªã®ã³ã³ãã¤ã©ã«æ¯ã¹ã¦å®è£ ã容æã§ããã¨æã£ã¦ãã¾ãã ããããCã®åã®æ§æã¯æããã«è¤éã§ããä¾ãã°ã`int **hoge[5];`ã®ããã«ã宣è¨ãããå¤æ°åã¨ãã®åãå ¥ãæ··ãããã¨ãããã¾ãããã®åé¡ã¯`int **hoge[5], foo;`ã®ãããªå®£è¨ããã¼ã¹ããã¨ãã«çãåããããªåãããã¾ããæ§æéãã«å®è£ ããã°åé¡ãªãã¨ããã°ããã¾ã§ã§ãããåã®è¡¨ç¾åã«å¯¾ãã¦æ§æã極端ã«è¤éãªã®ã§ãæ éã«ãã¹ãããªãã¨ãããªããã¤ã³ãã ã¨æãã¾ãã ä¸çªã®åé¡ã¯ãããããã¨å®è£ ã«ç¨ããè¨èªããããã¾ãããCã§Cã®ã³ã³ãã¤ã©ãæ¸ãã¨ããã¨ãASTã®æ±ããããã©ããããã§ããCã¯ããæå³ã§ãæªãæå³ã§ãèªç±ãªè¨èªãªã®ã§ãã¤ã¾ããªããã¹ããã¨ãã¨ã«ãªã£ã¦æ·±å»ãªãã°ã¨ãã¦çºè¦ããã¿ãããªãã¨ãããããªã«ãã¨å¤§å¤ããã§ãã [å4] ä½ãä»ã«ã¢ãã¼ã«ããããã¨ãããã°ãèªç±ã«æ¸ãã¦ãã ããããã®è¨åãå«ãã誤ã£ããã¨ãæ¸ãã¦ãã¦ãæ¸ç¹ã¯ãã¾ãããæ¸ãã¦ãããããã¨ã¯ãªãã§ãæ¸ãã¦ãã ããã GitHub : https://github.com/takoeight0821 Twitter : https://twitter.com/takoeight0821 ã¯ã¦ãªããã° : http://takoeight0821.hatenablog.jp
ããæãã®ã¡ã¢ã¢ããª
ã¡ãã£ã¨ããã¡ã¢ãæ¸ããããè¨ç®ã¡ã¢ã¨ããããããæç« ã®ä¸æ¸ãã¨ããåã¯å¸¸ã«PCã®åã«ãããã¹ãããæ¡ã£ã¦ããã®ã©ã¡ãããªã®ã§ããã¸ã¿ã«ãªããæ¹ã§ã¡ã¢ãæ¸ããã¨å¬ããã
ããããããã§ãã¡ã¢ã¢ããªãæ¢ãã¦ãã
ãã¬ã¼ã³ããã¹ããæ¸ããã°ããã®ã§ã便å©ãªãã¼ã¯ã¢ããã¯å¿ è¦ãªããããããã¼ãã¼ããå©ããéãã«å ¥åã§ãã¦ã»ããã
PCãããã¹ãããããåãã¡ã¢ãç·¨éããããæ®æ®µä½¿ããã¦ãã®ã¯MacãiPhoneãããã«Chromebookãªã®ã§ãWebã§å®çµãã¦ãã¼ã¿ã¯ã¯ã©ã¦ãã«ä¿åããã¦ã»ããã
é¸æè¢ã¯ããã¤ããããScrapboxã¯è»½éãªè¨æ³ã¨ãªã³ã¯ãåããã¡ã¢ã¢ããªã§ãã¾ãã«ã¹ã¯ã©ãã帳ã®ããã«ä½¿ããããã ãã¹ããããã®æä½æ§ããã¾ãè¯ããªããè¨æ³ã確åºããææ³ã®ãã¨ã«è¨è¨ããã¦ããæãã§ãScrapbox wayãªãã®æ¸ãã«ã¯ä¾¿å©ã ã*1ããªãã§ãScrapboxã§æºè¶³ã§ãã訳ã§ã¯ãªãã
Notionãæµè¡ã£ã¦ããMarkdownã£ã½ããã®ãæ¸ãããªãããªããã¹ãã¨ãã£ã¿ã¨ãªãã£ã¹ãã¼ã«ããã£ã¤ãããããªã¢ããªãããªã便å©*2ã ãããªãããªæ©è½ã使ãã«ã¯ãã¦ã¹ããªãã¨å°ã å³ãããã¾ãããªãããªæ©è½ã使ããªããã¨ããã®ãé£ããã
Googleããã¥ã¡ã³ãã¯ä¸ã¤ã®ã¹ã¿ã³ãã¼ãã«ãªãã¤ã¤ãã*3ãããããããã¼ã¸ã®æ¦å¿µãããã®ãåã®éè¦ã¨ãããããªããmacOSã»iOSã«çµã¿è¾¼ã¿ã®ã¡ã¢ã¢ããªã¯ããªãçæ³ã«è¿ã*4ããMacãiPhoneãããã使ããªãã
ç¡ããªãä½ãéããããã§ãããã¾ãæ°ãé²ã¾ãªããããããèããã¨ãã¡ã¢å¸³ã¨éçããã±ããã«å ¥ãã¦ãã¾ãã°äºè¶³ããããªãããæãã®ã¡ã¢ã¢ããªãç¡ãã®ãããªãã¨ãªãããã£ã¦ããã
ä»ã®äººã¯ã©ããã¦ããã ãããã©ããã£ã¦ã¡ã¢æ¸ãã¦ã¾ãï¼
*1:ä¾ãã°ã¢ã¤ãã£ã¢åºãã¨ãç°¡åãªãã¬ã¼ã³è³æãèªå·±ç´¹ä»ãã¼ã¸ãªããã«ä½¿ã£ã¦ãããªã¢ã«ã¿ã¤ã ãã£ããã¨ãã¦ä½¿ãã®ãé¢ç½ã
*2:è¨ç®ã¨ããã§ãã¦ãTRPGã§éã¶æã«éå®ãã¦ããããã¹ãã¨ã²ã¼ã ä¸ã®ãã¼ã¿ãä¸ã¤ã®ç»é¢ã§ç®¡çã§ãã
*3:åã¯èª°ãã¨æç« ãä¸ç·ã«æ¸ãæã¾ãGoogleããã¥ã¡ã³ããææ¡ãã
*4:æ®æ®µæç« ã®ä¸æ¸ãã¯iPhoneã®ã¡ã¢ã§æ¸ãã¦ãã
æ¥æ¬èªçãªãã¯ãã¼ã«ï¼RickRoll but make it Animeï¼
ãªãã¯ãã¼ã«ï¼Rickrollingï¼ãã¨ããããããã¼ã ããããæ¥æ¬ã®è ¹çã¹ã¬ã¨ä¼¼ãããããããé£ããã¿ã ã ã
ãã¤ã¦æ²ç¤ºæ¿ãµã¤ã4chanã§ãã¦ã½ã®ã¿ã¤ãã«ã§é²è¦§è ãé¨ããè»è¼ªã®ä»ããã¢ãã«ã®ããã¡ããèµ°ãåç»ãè¦ãããããããæµè¡ã£ã¦ãããããããduckrollãã¨å¼ã¶ãã©ãã«ä½ãã§ãããã¨ç§éã®è³ã®ä½ãã¯å¤ãããªããããã
ã¨ãããããæ¥ãã¢ãã«ã®ä»£ããã«ãªãã¯ã»ã¢ã¹ããªã¼ã®ãã®åæ²ãNever Gonna Give You Upããè²¼ã£ã天æãããããããããã£ã¡ãã£ã«ã¦ã±ã¾ãã£ããã¤ã³ã¿ã¼ãããã®ãã¼ãã½ã³ã°ãRickrollãã®èªçã§ããã*1
ä»ãRickrollingã¯è±ç±³ãä¸å¿ã«ããããã£åã®å®çªãã¿ã ã åé ã®åç»ã¯ãããããRickrollãã¢ãã¡ã®ãã¼ãæ²ã ã£ãããã¨ããã³ã³ã»ããã§ä½æããããããã ã©ãã¨ãªãã¸ã£ãã¼ãºãã¢ãã¡ããã©ãã¨ã¿ã¤ã¢ããããæ²ã£ã½ããæããã ãªãã»ã©ãã©ãã«ä½ãã§ãããã¨ç§éã®è³ã®ä½ãã¯å¤ãããªããããã
ããæ²ã¯ãã¯ãããmusicã§ãããåè«ã¯ããjokeã§ãããæåã¯ãã¯ãããcultureãªãã ã
*1:ã¨ãåã¯èªèãã¦ããã誤解ãã¦ããæèããããããããªããã¾ãã大çã¯ãããªæãã§ãã£ã¦ããã ããã