7 ms·
Solving the first 100 Project Euler problems using 100 languages
- teleforce 2y agoNo entry for proper static type languages namely C++, D, Go, Rust? Dynamic type language is what you want but static type language is what you need [TM].
- Jtsummers 2y agoAda, SML, F#, and more. Seems like you may not have looked at the list.
- klibertp 2y agoIt's more probable they skimmed and couldn't recognize those. There's Idris, Hare, Odin, V, Roc, Haskell, Nim, Haxe, PureScript, Vala, Lobster, and arguably Common Lisp and Dylan. That's from a single read of the list. Concluding there are no statically typed languages is only possible if you can't recognize them.
- teleforce 2y agoOK I stand corrected, but less than half of them that you've mentioned are not proper static type meaning that you cannot enforce and guarantee static and strongly type only Idris, Hare, Odin, V, Roc & Haskell. Only about 10% of the listed programming languages are proper static typed languages and most of the popular static typed languages are conveniently left out. They're missing the usual suspects of D, Rust, Ada, C++, Elm, Swift, Kotlin, Scala, TypeScript, Eiffel, Crystal, Modula-3, Futhark, Sather, VHDL, Verilog/SystemVerilog, etc.
- Jtsummers 2y ago> They're missing the usual suspects of D, Rust, Ada, C++, Elm, Swift, Kotlin, Scala, TypeScript, Eiffel, Crystal, Modula-3, Futhark, Sather, VHDL, Verilog/SystemVerilog, etc. Ada: #78 (which I listed in my initial response to you, and like the actual list, you apparently did not read). Verilog: #17 TypeScript: #54 Futhark: #94 You just keep making it clear that you didn't even look at the list. You're making things up now.
- teleforce 2y agoSure you're correct that I'm missed some of them but, the list are still missing many static languages that's my overall points: D, Rust, C++, Elm, Swift, Kotlin, Scala, Eiffel, Crystal, Modula-3, Sather, VHDL, etc. Also my main point of contention is that only small percentage of proper static languages (about 15%) are on the list if we include Ada, Futhark, Typescript and Verilog. Just don't lose the forest for the trees.
- tocs3 2y agoI am interested in seeing Verilog used as one of the 100 languages.I have been wondering how it would be to use some sort of hardware description language to solve some of (all?)the problems. I worked thru the first half of "Nand to Tetris" [1] and thought I might try working some of the problems with that. [1] https://www.nand2tetris.org/ https://www.nand2tetris.org/
- 7thaccount 2y agoI wonder which ones the author liked the most and which they disliked the most. I didn't see any comments on that. If they're on HN, it'd be cool to find out.
- fuzzythinker 2y agoIt's hard to form a good opinion of a language if the knowledge of it is shallow, which I'm inclined to believe based on using 100 languages. More interesting is why the author decide to use a particular language for each problem.
- middayc 2y agoThe author wrote a short comment about each language in the following blogposts: https://log.schemescape.com/posts/100-languages/index.html https://log.schemescape.com/posts/100-languages/index.html
- nekitamo 2y ago100 languages and yet not a single use of Rust. The omission feels like a statement.
- sramam 2y ago> using a different--and, ideally, new to me--language for each problem Perhaps this is why?
- nekitamo 2y agoAh I missed that part, thank you. The omission comment was tongue-in-cheek on my part.
- 420official 2y agoThe author wanted to use languages that were new to them, if the author has enough familiarity with rust to have a vendetta then it probably isn't new to them.
- NotAnOtter 2y agoIt's hard to make me hate something I've never engaged with and yet the Rust community has managed to do it with their overzealous love. It's a language guys. It won't give you a BJ
- jtsiskin 2y agoTo be more inclusive, consider using “it won’t go down on you” rather than “won’t give you a BJ”
- NotAnOtter 2y agoIt won't give anyone a BJ. Independent of if they could hypothetically receive one or not.
- dgfitz 2y agoI have always heard both terms used interchangeably ignoring gender. Maybe you need to broaden your own limited horizons instead of claiming others need to be more inclusive.
- omoikane 2y agoI like how the author used four different variants of BASIC.
- krick 2y agoI'm curious if they are really, like, different. All Basic that I've seen in my life was a minuscule bit of VB and some really ancient programming book I've picked up when I was like 7 y.o. and didn't really have access to a computer.
- MaysonL 2y agoBack in the day, over a decade or so, I wrote a few megabytes of VAX Basic. The language, and the code I wrote, at the end of that period looke nothing like it did at the beginning. So yes, it’s quite likely that the Basics are substantially different.
- cgh 2y agoAmigaBasic is quite different from Commodore Basic v2.0, and that’s within the same company.
- omoikane 2y agoI remember QBasic was notably different from Applesoft Basic in that QBasic did not require line numbers, and one of the demo programs (remline.bas) removed line numbers for you. Of the variants used by this author, the Commodore Basic variant is distinct in being the only one with line numbers. The others all look very similar.
- hmng 2y agoFrom one of the blog posts: > 8080 assembly (Altair 8800) > > First time I've heard of binary-coded decimals I’m really surprised with that, that someone with such broad interests never heard of BCD. I mean, there’s is always something new to learn all the time, don’t get me wrong, nothing to criticize, just plain surprised. Wonder if that is just something older people came across?
- adhamsalama 2y agoI did learn binary-coded decimals in college 5 years ago.
- munchler 2y agoOld PL/I programmer here. I’m still trying to forget BCD’s from the 80’s!
- drysine 2y agoI learned about BCD when I was learning x86 assembly and have never came across them later. They are gone in x64.
- prof-dr-ir 2y agoImpressive, but after reading the title I have to admit to being a little disappointed at not finding 10,000 solutions.
- ahpeeyem 2y agoYeah when I read that they "started this journey in March of 2024 and...completed it in January of 2025" I was like :o
- nradov 2y agoThat's cute but if you can't solve those problems in INTERCAL then can you even call yourself a programmer? (But seriously this is pretty cool.)
- joshuamcginnis 2y agoLet's say an experienced engineer is starting Euler for the first time. What's the best way to approach it given that many of the problems require some prerequisite algorithmic knowledge to solve? Is there a good method for approaching Euler and LeetCode problems with new eyes aside from reading the solutions first, studying them and then solving it many times until committed to memory?
- eru 2y agoIMHO, Project Euler is a lot harder than LeetCode and requires a lot more math. I'm not sure why you would want to solve it many times and committing those solutions to memory? I think you would be better off using some of the time to just read some text books? For some of Project Euler https://www2.math.upenn.edu/~wilf/gfology2.pdf https://www2.math.upenn.edu/~wilf/gfology2.pdf is a good math book to consult. The techniques in there will allow you to solve some of the problems with just pen and paper (and perhaps a pocket calculator, if you are too lazy to do the arithmetic by hand, but no need for a full blown programmable computer), especially the first few problems if memory serves right. Eg where they ask you to add up the first few billion even terms of the Fibonacci numbers and similar; you can just derive a simple closed formula and evaluate that by hand.
- xzyyyz 2y ago
- xzyyyz 2y agoI find it rather annoying and irrespectful for Project Euler. They specifically ask not to publish solutions. Some other collection could be used for demonstration of skills and languages.
- thunkingdeep 2y agoWell, HN specifically asks for people to not comment shallow dismissals of others work, but here we are…
- eru 2y agoI know they ask, but it's really easy to find solutions online. For what it's worth, when I was doing Project Euler myself, I never had a problem _not_ looking up solutions.
- wesselbindt 2y agoJust because a bus stop already has a broken window does not make it ok to smash in another.
- eru 2y agoYes, but it's also a bit like closing the barn door after the cows have escaped.
- deleted 2y ago[deleted]
- sigbottle 2y agoThe first 100 problems are fair game to publish, I can't find it on their website anymore, but it's generally accepted that this is the case. You can check out the project euler discord for more authoritative information on this
- portercable 2y agoFrom Project Euler homepage: > the rule about sharing solutions outside of Project Euler does not apply to the first one-hundred problems
- entaloneralie 2y agoWowow! this is fantastic, so many exciting and weird languages in there, even Mouse-83 is in the list! It was really nice to read about the author's impression of each language. Well done
- deleted 2y ago[deleted]
- moomin 2y agoWorth emphasising: Project Euler is a mathematical computation challenge, not a programming challenge like Advent of Code. The principal skill is algorithm design and as the problems progress you need to do more and more maths before you start coding.
- thaumasiotes 2y agoDo you ever need to start coding? I thought it was a requirement of the project that problems be solvable with pencil and paper.
- wholinator2 2y agoWell you probably _could_ whiteboard it but some of them are about extending a pattern to the millionth term. If you're really smart you might be able to find a closed form to get there quick, but you can also just program the basic rule and iterate
- KeplerBoy 2y agoAfaik most of them require you to find the trillionth term, rendering naïve approaches futile.
- mudita 2y agoWhile some problems are actually solvable with just pencil and paper, this is not a requirement and the intention of the project is that problems will be solved with a combination of insight and coding. From the Project Euler website: "Project Euler is a series of challenging mathematical/computer programming problems that will require more than just mathematical insights to solve. Although mathematics will help you arrive at elegant and efficient methods, the use of a computer and programming skills will be required to solve most problems."
- marsten 2y agoFor the harder Euler problems you usually need a combination of mathematical insight and good coding technique. Each problem typically provides sample values for smaller instances of the problem, which you can confirm with a straightforward solution approach. Then the actual problem will be to calculate f(10^500) or some absurd value that requires insight to make tractable. They are extremely good challenges overall.
- callc 2y agoI solved the first 100 problems a long time ago before learning the best practices we learn as professional engineers. It’s alien code now.
- gre 2y agoWhy did I expect 10,000 files?
- acrophiliac 2y agoI'm totally with you, bro. Maybe the headline should have been "Solving 100 project Euler problems using a different programming language for each one" but that's probably way too verbose.
- karmakaze 2y agoI expected 100x100 programs too without thinking how unreasonable that is. But sometimes it's hard to gauge what's unreasonable on HN. "Solving the first 100 Project Euler problems in as many languages" does the trick and is only one character longer.
- drysine 2y ago>how unreasonable that is It was a year or two ago.
- deleted 2y ago[deleted]
- archargelod 2y agoFrom one of blog posts [0]: Nim Nim is the language that impressed me the most in this batch. Everything I thought would be a problem (significant whitespace, choose-your-own-function syntax, intermediate C compliation step) didn't bother me at all. The small sample of the standard library I played with was a little quirky, but Nim seems like excellent bang for your buck. Notes: - Release binary was only 120 KB (linked against libc)! - Thought I'd dislike the syntax, but it was fine - Really easy to get started, many things "just worked" (e.g. grabbing a slice of an array) - Didn't have to specify too many types, but still ran fast - Fast compilation - Didn't like the "hints" it spews out during compilation, even for nim r (build and run) - Why did all take an anonymous function, but foldl took just an expression (with a and b seemingly picked out of thin air) -- is foldl a macro? - Nim might be a good language for hobby projects because it's easy, fast, and produces small binaries - I wonder what the debugging experience is like -- if it's decent, I might be writing a lot more Nim in the future! This exactly my thoughts on Nim and why I use it almost exclusively for all my hobby projects. 0-https://log.schemescape.com/posts/programming-languages/100-languages-9.html https://log.schemescape.com/posts/programming-languages/100-...
- giancarlostoro 2y agoNim is a gem and I wish it was more mainstream than it is. Its older than both Rust and Go.
- utopcell 2y agoHorrible, just horrible. Why would one release this publicly?
- LPisGood 2y agoWhy not? It seems like it’s worth sharing.
- utopcell 2y agoThere are a lot of people that have spent copious amounts of time solving these problems. Fewer than 1.4% of the registered Eulerians have solved more than 100 problems. Releasing the solutions for these trivializes their work, as now anyone can copy them (unless the assumption here is that solutions to all those 100 problems have been previously released on the net).
- LPisGood 2y agoIt doesn’t trivialize their work at all - they should still be proud of their accomplishments. Does releasing the Putnam answers make winning a mathematics olympiad less meaningful, after all I can copy those answers easily. Does learning how to implement distributed locking besmirch Lamport’s legacy? Even still, the project itself approves of releasing solutions to the top 100 problems.
- utopcell 2y ago> Does releasing the Putnam answers make winning a mathematics olympiad less meaningful, after all I can copy those answers easily. Yes, it would make winning a math olympiad meaningless if the exact problems could be copied by someone and submitted as their own. Of course this is not how written exams work, which makes your comparison meaningless. The same arguments can be applied not just the first 100 problems, but to all of them. To me, seeing someone that has solved more than 300 problems is incredibly impressive. It would not be so if every Dick and Harry could copy them and submit them as their own.
- lbj 2y agoHappy to see Mouse83 get some air time :)
- xiaodai 2y agothe julia solution was bad
- deleted 2y ago[deleted]
- kazinator 2y agoPretty sure the first one should be done with a closed form formula: lcm(3, 5) = 15. So there is a repeating cell of values every 15 which we can take advantage of: 0, 3, 5, 6, 9, 10, 12, + 15 -> 15, 18, 20, 21, 24, 25, 27, + 15 -> 30, 33, 35, 36, 39, 40, 42 The last cell ending in 1000 is incomplete.
- lincpa 2y ago[dead]