Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old May 7, 2017, 02:14   #41
t4nk
Adept
 
Join Date: May 2016
Posts: 246
t4nk is on a distinguished road
^Hey, guys, I'm not talking about roguelikes, more like in general. BTW, I'm not actually going to rewrite Angband in anything
t4nk is offline   Reply With Quote
Old May 7, 2017, 02:18   #42
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 52
Posts: 6,459
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by t4nk View Post
BTW, I'm not actually going to rewrite Angband in anything
Well, you've already rewritten a fair chunk of it in C...
__________________
One Ring to rule them all, One Ring to find them,
One Ring to bring them all and in the darkness bind them.
Nick is offline   Reply With Quote
Old May 11, 2017, 18:16   #43
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,261
AnonymousHero is on a distinguished road
Another option which might be interesting would be to target browsers directly with something like Scala.js.

EDIT: It has quite a big "runtime" (scala-library-as-js), but if you have game assets anyway they would probably dwarf that.
AnonymousHero is offline   Reply With Quote
Old May 12, 2017, 17:45   #44
t4nk
Adept
 
Join Date: May 2016
Posts: 246
t4nk is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
Another option which might be interesting would be to target browsers directly with something like Scala.js.

EDIT: It has quite a big "runtime" (scala-library-as-js), but if you have game assets anyway they would probably dwarf that.
Why are you always suggesting some bizarre functional languages like Racket, Haskell and now... Scala? ...js?
Anyway, Rust is pretty interesting, but it's verbose, full of Ocaml-isms (I don't see any particular advantages in them) and poorly documented. It's probably a good replacement for Ada.
I also changed my opinion on D again It's more general purpose than Rust, the flaws have workarounds and, all in all, Angband should be rewritten in D
t4nk is offline   Reply With Quote
Old May 12, 2017, 21:09   #45
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,261
AnonymousHero is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Why are you always suggesting some bizarre functional languages like Racket, Haskell and now... Scala? ...js?
Well, they're good languages .

(Scala less so, but still a lot better than most things. Especially things that can target JS.)

Quote:
Originally Posted by t4nk View Post
Anyway, Rust is pretty interesting, but it's verbose, full of Ocaml-isms (I don't see any particular advantages in them) and poorly documented. It's probably a good replacement for Ada.
Algebraic Data Types + pattern matching are absolutely amazing when you want to model a domain, though. (That plus traits, in the case of Rust.)

Not sure if D can do ADTs, but you can probably hack something similar using macros.
AnonymousHero is offline   Reply With Quote
Old May 12, 2017, 22:07   #46
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,817
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
Well, they're good languages .

(Scala less so, but still a lot better than most things. Especially things that can target JS.)
Have you seen Elm? It's a very neat language, I think derived from Haskell, designed to be accessible for people who aren't into functional programming (which is me) but still has ADTs, and compiles into JS. I've not used it for anything yet but its design has heavily influenced a pure JS project I'm working on and made it a ton more manageable.
__________________
"Physician, heal thyself."
takkaria is offline   Reply With Quote
Old May 12, 2017, 22:21   #47
t4nk
Adept
 
Join Date: May 2016
Posts: 246
t4nk is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
Algebraic Data Types + pattern matching are absolutely amazing when you want to model a domain, though.
Well, even Angband has algebraic data types, you know
Code:
typedef union {
	ui_event_type type;
	struct mouseclick mouse;
	struct keypress key;
} ui_event;
Quote:
Not sure if D can do ADTs, but you can probably hack something similar using macros.
Hm, I just discovered that it actually does have those in the standard library:
Code:
void main()
{
    import std.variant : Algebraic, visit;

    alias Option = Algebraic!(int, string);

    void print(const ref Option o)
    {
        import std.stdio : writeln;

        o.visit!((string s) => writeln("got string: ", s),
                 (int n)    => writeln("got number: ", n));
    }

    Option o = 99;
    print(o);

    o = "some text";
    print(o);

    o = 1024;
    print(o);
}
These things still don't strike me as a super cool feature, though
t4nk is offline   Reply With Quote
Old May 13, 2017, 02:22   #48
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,261
AnonymousHero is on a distinguished road
Quote:
Originally Posted by t4nk View Post
Well, even Angband has algebraic data types, you know
No, not event close. You can pretend all you like, though .

One of the major points of ADTs is to make illegal states undrepresentable -- and unions don't do that. In fact they possibly even make things worse because the programmer may easily get it wrong... leading to UB.

Quote:
These things still don't strike me as a super cool feature, though
Have you tried actually using them with pattern matching... and "making illegal states unrepresentable", etc? (I'm talking in e.g. O'Caml, Haskell or the like. Not in toy programs either -- real programs.)

(Interesting to see that D has an emulation of ADTs. I haven't tried D enough to know whether they're useful there, but having to use visitors to deconstruct (rather than true pattern matching) seems like it would basically cripple them.)

I promise you, if you actually start using "true" ADTs + pattern matching, you'll change your mind .

Anyway, we've veered quite a bit off topic from VS2015, so I'll stop here .
AnonymousHero is offline   Reply With Quote
Old May 13, 2017, 02:24   #49
AnonymousHero
Veteran
 
AnonymousHero's Avatar
 
Join Date: Jun 2007
Posts: 1,261
AnonymousHero is on a distinguished road
Quote:
Originally Posted by takkaria View Post
Have you seen Elm? It's a very neat language, I think derived from Haskell, designed to be accessible for people who aren't into functional programming (which is me) but still has ADTs, and compiles into JS. I've not used it for anything yet but its design has heavily influenced a pure JS project I'm working on and made it a ton more manageable.
Yes, but only tried it a little bit. It's too anemic for my taste, but it's lovely for what it is. (Especially if you can live with the rather low power ceiling.)
AnonymousHero is offline   Reply With Quote
Old May 14, 2017, 08:47   #50
t4nk
Adept
 
Join Date: May 2016
Posts: 246
t4nk is on a distinguished road
Quote:
Originally Posted by AnonymousHero View Post
Have you tried actually using them with pattern matching... and "making illegal states unrepresentable", etc? (I'm talking in e.g. O'Caml, Haskell or the like. Not in toy programs either -- real programs.)
Hm, don't recall doing that. Most of my experience with functional programming is from tinkering with Common Lisp (hated that thing and it's not particularly functional anyway), and Erlang, which was pretty nice. I especially liked the huge amount of mutable state it had - that's probably because it was used to solve practical problems, not doing research or proving some theories
And, yeah, the C++ template language, which kind of scarred me for life

Quote:
Anyway, we've veered quite a bit off topic from VS2015, so I'll stop here .
Yes, we haven't heard anything from the OP, so I guess he didn't manage to compile Angband with VC++.
t4nk is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiling Z+Angband Ravenheart87 Variants 7 May 24, 2011 08:35
Compiling 3.2 Omnipact Development 6 December 27, 2010 09:39
compiling in VC6 NeoWizard Vanilla 1 January 16, 2009 02:10
Compiling in Linux trickypig Vanilla 6 November 16, 2008 15:26
Compiling 3.0.9b under SuSE 9.3 ... TJA Vanilla 14 May 12, 2008 21:17


All times are GMT +1. The time now is 07:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.