Giter Club home page Giter Club logo

Comments (7)

1000000000 avatar 1000000000 commented on July 27, 2024 1

@DJMcMayhem I think your idea for the flags is the best one proposed so far but I think the distinction between ASCII output and Unicode output is important (I totally agree that we can do away with ASCII input though). My proposal would be to add either one or two new flags to flags to handle unicode output. The modifications to existing I/O flags:

  • -a sets ASCII/UTF8 input but does not change output
  • -A sets ASCII output but does not change input
  • -c sets ASCII output an ASCII/UTF-8 input

The new flag

  • -U sets UTF-8 output but does not change input

We might want to add the following flag as well to shave off an extra byte from ASCII/UTF-8 in UTF-8 out programs

  • -C sets UTF-8 output and ASCII/UTF-8 input

Overall, this only increases the number of flags by one. The one thing that irks me about this scheme is that it lacks a method for returning to decimal output from ASCII output. I also think we should keep the -u flag around for backwards compatibility but either mark it as deprecated or drop it from our documentation.

from brain-flak.

DJMcMayhem avatar DJMcMayhem commented on July 27, 2024

I think this is a great idea, and it's something I've been thinking about for a while. I like this plan, but it ove complicates some things. This means we'd have 4 different (possibly contradicting) flags just for various IO modes. And also, what should happen if the -u and -a flags ever contradict each other?

I have a proposal that would simplify the whole thing though. What if we dropped the idea of "UTF-8 IO" entirely, and then changed "ASCII IO" to Unicode IO? I think this has many advantages. For example:

  • Less flags to remember.
  • Backwards compatible, other than the fact that ASCII wraps, which to my knowledge, no programs are currently taking advantage of.
  • More intuitive. Rather than caring about various encodings, you can just think of IO as either "Decimal" or "Character code-points".

I like this approach much more, but I'd like to hear what @Wheatwizard thinks before going and implementing it, especially since I remember them being opposed to this idea before.

from brain-flak.

Wheatwizard avatar Wheatwizard commented on July 27, 2024

I prefer the different ASCII and UTF-8 flags, but I do agree that the flags as they are now is problematic. I would propose a new 6 flag system (4 flags if we decide to collapse UTF-8 and ASCII):

  • -a sets ASCII input but does not change output
  • -A sets ASCII output but does not change input
  • -d sets decimal input but does not change output
  • -D set decimal output but does not change input
  • -u sets UTF-8 input but does not change output
  • -U sets UTF-8 output but does not change input

These flags can be combined to make all of the possible input and output schemes.

from brain-flak.

Mega-Tom avatar Mega-Tom commented on July 27, 2024

The problem is that flags are binary while I/O formats are trinary. Codewise, your problem is that booleans contradict each other. You need an enumeration with three states. inputMode = 1 for decimal, 2 for ASCII or 3 for UTF-8.

from brain-flak.

DJMcMayhem avatar DJMcMayhem commented on July 27, 2024

@Wheatwizard That seems too complicated to me. One because decimal is default, so there's no reason to specify it, and two because I don't see why it's necessary to have a distinction between ASCII and UTF 8. I'd like to do it like this:

  • -a sets ASCII/UTF8 input but does not change output
  • -A sets ASCII/UTF8 output but does not change input
  • -c sets ASCII/UTF8 input and output.

Obviously, if we did this we'd have to change ASCII's "Wrap at 127" to "Wrap at 65,536". Do you have any objections?

from brain-flak.

Wheatwizard avatar Wheatwizard commented on July 27, 2024

Hey whats going on with this issue. I don't care much which option we choose as long as it is not the current one. Hopefully we can get this fixed soon.

from brain-flak.

DJMcMayhem avatar DJMcMayhem commented on July 27, 2024

This is done in version 1.2! Closing now

from brain-flak.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.