News for hackers. Stuff that matters.
Re:Ask HN: What are you learning? by sunsetSamurai on Sunday April 05, 2020 @06:22PM (#22789237)
I'm studying DS and Algorithms, I am a self taught developer and I'm trying to fill some gaps in my general CS knowledge.

There's a project I want to work on but I feel a bit overwhelmed and don't know where I should start, I'd appreciate some advice here.

I want to create shogi(Japanese chess) server, similar to lichess, the thing is that I've never done anything similar to this, I've been reading about web sockets, this seems like a good place to start. I plan to use elixir for the backend, is this a good choice? Lichess uses scala, should I use this instead?

Re:Ask HN: What are you learning? by blihp on Sunday April 05, 2020 @06:58PM (#22789441)
My advice would be don't bite off so much at once where you'll risk getting discouraged. Part of the reason you may be feeling overwhelmed is that it sounds like you're combining three projects: learning a new programming language, learning network programming, and writing an application server in a new (to you) domain. Any one of them is potentially enough to keep you quite busy.

Why not instead start with a language you already know, and figure out how you'd sketch out a standalone game engine (forget about networking for now) in that. Then once you think you've got the basic game engine (architecture, at least) down, then tackle turning it into a network server (again, still using a language you already know.) Finally, port the thing over to a language you want to learn (Elixir/Scala/whatever) and you'll have an implementation you understand well to compare it against. Of course you can rearrange the sequence... but that's the basic idea.

Re:Ask HN: What are you learning? by sunsetSamurai on Sunday April 05, 2020 @07:29PM (#22789613)
I think you're definitely right, I'll try to give it a try using javascript, and learn the basics of network server along the way. The reason I wanna do it in elixir is that I wanna learn another language, right now javascript is the only one I can say that I know kind of well, all my side projects are in js, so I guess I'm a bit bored of it.
Re:Ask HN: What are you learning? by paladin314159 on Sunday April 05, 2020 @06:48PM (#22789378)
I built kfchess.com (https://github.com/paladin8/kfchess), which might be a helpful reference. It's by no means amazing code (I hacked it together quickly in my spare time), but it uses https://github.com/socketio/socket.io for real-time client-server communication. It's a relatively simple library to build on top of.

As for the backend, I would recommend whatever you're most familiar with. It doesn't make that much of a difference and you'll be way more productive in a language you know.

Love the idea of a Shogi site by the way!

Re:Ask HN: What are you learning? by sunsetSamurai on Sunday April 05, 2020 @07:34PM (#22789646)
Your project looks really cool, I'll take a look at your repo, I'm sure I can learn a lot from it.

I am gladd you like my idea, there's a few good platforms to play shogi already, like 81dojo on the web and shogiwars on mobile, but none of them are open source. So I wanna do an open source version similar to lichess.

Re:Ask HN: What are you learning? by bigbassroller on Sunday April 05, 2020 @06:49PM (#22789386)
I think Elixir would be an excellent choice. Once you have a sip, you’ll never want to go back. Might I recommend this book: https://pragprog.com/book/lhelph/functional-web-development-... there might be some overlap with your Shogi game idea to get you started.
Re:Ask HN: What are you learning? by sunsetSamurai on Sunday April 05, 2020 @07:36PM (#22789655)
Thank you for the book, I'll take a look at it.
Re:Ask HN: What are you learning? by ing33k on Sunday April 05, 2020 @11:05PM (#22790622)
Elixir / Phoenix is indeed very good in handling websockets. Probably that's the easy part in your project.
Re:Ask HN: What are you learning? by evsamsonov on Monday April 06, 2020 @04:15PM (#22797339)
I guess Elixir is a good choice. Just can advise a couple of good video courses in addition to books. 1. https://pragmaticstudio.com/unpacked-multi-player-bingo-with.... 2. https://codestool.coding-gnome.com/courses/elixir-for-progra.... In [2] Dave Thomas, author of a Programming Elixir book, goes through creation of online game too.