Commit Graph

32 Commits

Author SHA1 Message Date
Zoltan Somogyi
e6d1ce383e Update the coding standard.
The main change is requiring the explicit use of streams
in I/O operations in the compiler.
2016-10-07 08:03:52 +11:00
Zoltan Somogyi
d8a69878e7 Delete or update some obsolete elements. 2015-11-28 22:52:41 +11:00
Paul Bone
96c1cbb82e Fix last commit.
compiler/notes/coding_standards.html:
    As above.
2015-11-23 10:59:37 +11:00
Paul Bone
ff464eb13e Update coding standard regarding if-then-else syntax
compiler/notes/coding_standards.html:
    As above.
2015-11-23 10:32:56 +11:00
Julien Fischer
d2eeae6474 Replace module qualifiers in coding standards.
compiler/notes/coding_standards.html:
	Use '.' as the module qualifier.
2015-01-05 16:56:51 +11:00
Julien Fischer
4c9079a179 Fix minor errors in the compiler's notes directory.
compiler/notes/c_coding_standard.html:
compiler/notes/compiler_design.html:
compiler/notes/reviews.html:
compiler/notes/todo.html:
	As above.
2015-01-05 12:23:11 +11:00
Julien Fischer
cd3540c975 Coding standard change: module qualification in library interfaces.
compiler/notes/coding_standards.html:
	Specify that library module interfaces should avoid module
	qualification where possible.

	Minor formatting improvements and (a few) rewordings.
2014-10-10 12:46:49 +11:00
Julien Fischer
c96e3b495b Merge branch 'version-14_01-branch' 2014-06-26 15:00:16 +10:00
Peter Wang
31d3897e22 Thread-safe alternative to strerror.
Add MR_strerror as a thread-safe alternative to strerror.
The current implementation wraps strerror_r(), strerror_s()
or sys_errlist as appropriate for the platform.  Bug #340.

configure.ac:
runtime/mercury_conf.h.in:
	Check for strerror_r, strerror_s.

	Delete irrelevant code in the sockets test for the external debugger.

runtime/mercury_runtime_util.c:
runtime/mercury_runtime_util.h:
	Add MR_strerror and use it.

library/io.m:
	Use MR_strerror.  In particular, mercury_output_error was not
	thread-safe.

	Pass errno to mercury_output_error explicitly for clarity.

	Delete req_lock parameter in ML_maybe_make_err_msg macro which is not
	needed any more.

compiler/prog_event.m:
runtime/mercury_deep_profiling.c:
runtime/mercury_misc.c:
runtime/mercury_term_size.c:
runtime/mercury_trace_base.c:
trace/mercury_trace_cmd_developer.c:
trace/mercury_trace_cmd_exp.c:
trace/mercury_trace_cmd_misc.c:
trace/mercury_trace_declarative.c:
trace/mercury_trace_external.c:
trace/mercury_trace_internal.c:
	Use MR_strerror.

compiler/notes/coding_standards.html:
	Update coding standard.

extras/net/sockets.m:
extras/net/tcp.m:
	Use MR_strerror.

NEWS:
	Announce change.
2014-06-25 17:32:58 +10:00
Paul Bone
d8b48ca53c Merge compiler notes
We had been maintaining two copies of these notes, this change attempts to
merge them into one set.  The cononical location for these notes is here in
compiler/notes/, they will be removed from the www repository.

I've also updated a number of URLs.

compiler/notes/allocation.html:
compiler/notes/bootstrapping.html:
compiler/notes/coding_standards.html:
compiler/notes/compiler_design.html:
compiler/notes/gc_and_c_code.html:
compiler/notes/glossary.html:
compiler/notes/release_checklist.html:
compiler/notes/reviews.html:
compiler/notes/todo.html:
compiler/notes/work_in_progress.html:
    Merge in differences with the versions of these files in the www
    repository.  Most differences are trivial.

compiler/notes/bytecode.html:
compiler/notes/c_coding_standard.html:
compiler/notes/developer_intro.html:
    Add files that were missing from the main repository but were on the
    website.
2014-02-12 13:37:00 +11:00
Peter Wang
ef81b66625 Move the intermodule analysis framework into the `compiler' directory, in
Estimated hours taken: 2
Branches: main

Move the intermodule analysis framework into the `compiler' directory, in
preparation for making it specific to the Mercury compiler, rather than having
it generic in case some fictional being might want to use it with a .NET
compiler one day.  This will make it easier to use and modify.

compiler/analysis.file.m:
compiler/analysis.m:
	Copy these files from the `analysis' directory.

compiler/top_level.m:
	Include analysis.m as a new package.

compiler/Mercury.options:
	Add a bug workaround line from analysis/Mercury.options.

analysis/Mercury.options:
analysis/Mmakefile:
analysis/analysis.file.m:
analysis/analysis.m:
analysis/mer_analysis.m:
	Replace the contents of these files with comments that the analysis
	framework is now in the `compiler' directory.  We don't actually
	delete them so their histories remain easily accessible.

analysis/README:
	Mention that the code has been moved.

compiler/notes/compiler_design.html:
compiler/notes/overall_design.html:
	Update documentation.

Mmake.workspace:
Mmakefile:
configure.in:
compiler/.mgnuc_copts:
compiler/COMP_FLAGS.in:
compiler/Mmakefile:
deep_profiler/.mgnuc_copts:
scripts/Mmake.vars.in:
scripts/c2init.in:
scripts/mercury_config.in:
scripts/prepare_tmp_dir_fixed_part.in:
tools/binary:
tools/binary_step:
tools/bootcheck:
tools/lmc.in:
tools/make_arena:
compiler/notes/coding_standards.html:
	Remove references to the `analysis' directory and `libmer_analysis'.
2008-02-20 03:10:00 +00:00
Julien Fischer
8113fc0818 Mention that module imports from the analysis directory should be
Estimated hours taken: 0
Branches: main

compiler/notes/coding_standards.html:
	Mention that module imports from the analysis directory should be
	grouped with those from the compiler and mdbcomp directories.
2006-02-01 07:39:12 +00:00
Julien Fischer
e3b19bbfd2 Add expect/3 as a replacement for require/2 in the compiler.
Estimated hours taken: 0.1
Branches: main

compiler/compiler_util.m:
	Add expect/3 as a replacement for require/2 in the compiler.

compiler/notes/coding_standards.html:
	Update some references: s/error_util/compiler_util/

	Mention that in the compiler we should use expect/3 rather
	than require/2.
2005-11-18 06:22:53 +00:00
Julien Fischer
7112c41c35 Clean up the formatting of comments in this module.
Estimated hours taken: 0.5
Branches: main

compiler/hlds_goal.m:
	Clean up the formatting of comments in this module.

	Add a comment about why there is duplicate information
	in the representation of unifications.

	Use unexpected/2 in preference to error1.

	s/creater/creator/

compiler/notes/coding_standards.html:
	Fix a misformed tag.
2005-05-10 04:58:30 +00:00
Zoltan Somogyi
50d252d507 Document the proper format of foreign_procs, and request no trailing
Estimated hours taken: 0.2
Branches: main

Document the proper format of foreign_procs, and request no trailing
white space.
2005-03-31 00:51:56 +00:00
Zoltan Somogyi
f95e2bbcce Style fixes.
Estimated hours taken: 0.2
Branches: main

compiler/notes/coding_standards.html:
	Style fixes.
2005-03-30 06:19:25 +00:00
Zoltan Somogyi
f28db724d5 Update the coding standard to ask for each import_module to import
Estimated hours taken: 1
Branches: main

compiler/notes/coding_standards.html:
	Update the coding standard to ask for each import_module to import
	only one module even if the module is from the library.

	Update the coding standard to reflect current accepted practice
	with respect to indentation and the formatting of type definitions.
2005-03-21 05:51:25 +00:00
Ralph Becket
a2033e4b8b Added a comment regarding the use of DCG notation and state
Estimated hours taken: 0.1
Branches: main

compiler/notes/coding_standards.html:
	Added a comment regarding the use of DCG notation and state
	variables, particularly with respect to IO.
2005-03-07 01:05:35 +00:00
Julien Fischer
4935f0bc26 If a grouping of predicate, mode and function declarations
Estimated hours taken: 0.1
Branches: main

compiler/notes/coding_standards.html:
	If a grouping of predicate, mode and function declarations
	occurs in the interface one of the standard library modules
	specify that the function declaration should listed before the
	others.  The rationale for doing this is to make the library
	reference manual more consistent (it also makes it easier
	to see if there is a function version of a predicate.
2004-10-14 04:31:32 +00:00
Julien Fischer
b18ebaa473 Update coding standards for interfaces in the
Estimated hours taken: 1
Branches: main

Update coding standards for interfaces in the
standard library.  The intent is to improve the
library reference guide.

compiler/notes/coding_standards.html:
	Modify the coding standards to specify how descriptive
	comments for library procedures should be placed.
	By fixing a style (hopefully) the library reference guide
	should have a more consistent appearance.

	Specify that predmode syntax should be used in preference
	to a separate mode declaration if a predicates has only
	one mode.

	Specify that descriptive comments for procedures should
	ideally state under which conditions the procedure can
	fail (if it can) or throw an exception.
2004-04-05 13:45:51 +00:00
Fergus Henderson
79116cfb20 Document that "++" should be used for string literals that don't
Estimated hours taken: 0.25
Branches: main

compiler/notes/coding_standards.html:
	Document that "++" should be used for string literals that don't
	fit on a single line.
2004-01-12 12:06:31 +00:00
Julien Fischer
255ac0898c s/fatal_error()/MR_fatal_error()/
Estimated hours taken: 0.1
Branches: main

compiler/notes/coding_standards.html:
	s/fatal_error()/MR_fatal_error()/
2003-12-10 07:09:34 +00:00
Fergus Henderson
c1626d9f1a Specify that code should generally be ordered top-down, not bottom-up.
Estimated hours taken: 0.25
Branches: main

compiler/notes/coding_standards.html:
w3/information/developers/c_coding_standard.html:
	Specify that code should generally be ordered top-down, not bottom-up.
2003-11-13 13:06:07 +00:00
Fergus Henderson
7806be964a Mention the use of the work_in_progress.html file.
Estimated hours taken: 0.25
Branches: main

compiler/notes/coding_standards.html:
	Mention the use of the work_in_progress.html file.
2003-10-22 06:02:29 +00:00
Fergus Henderson
b0e95e0b14 Add some documentation about the layout for section header comments.
Estimated hours taken: 0.25
Branches: main

compiler/notes/coding_standards.html:
	Add some documentation about the layout for section header comments.
2003-08-18 11:36:40 +00:00
Mark Brown
8ed1a62608 State the rationale for our line width limit.
Estimated hours taken: 0.1
Branches: main

compiler/notes/coding_standards.html:
	State the rationale for our line width limit.
2002-07-17 06:23:57 +00:00
Fergus Henderson
ee481bf0c0 Add two new guidelines:
Estimated hours taken: 0.25
Branches: main

compiler/notes/coding_standards.html:
	Add two new guidelines:
	- procedures defined using foreign code should be documented carefully
	- in the compiler, use unexpected/2 or sorry/2 rather than error/1
2002-03-26 01:17:05 +00:00
Mark Brown
cb24c35c2e Minor cleanup of some html.
Estimated hours taken: 0.1

Minor cleanup of some html.

compiler/notes/coding_standards.html:
	Get rid of some empty paragraphs.  Update a reference to a
	filename which has changed.
2002-03-25 05:30:02 +00:00
Mark Brown
3ee59d5003 Improvements to the "Layout" section of the Mercury coding standards.
Estimated hours taken: 0.1
Branches: main

Improvements to the "Layout" section of the Mercury coding standards.

compiler/notes/coding_standards.html:
	Split the layout section into paragraphs, to make it easier to
	read.  Add the requirement that, like if-then-elses, all disjunctions
	should be parenthesized.
2002-03-19 05:24:27 +00:00
Fergus Henderson
ad9a812e99 Fix an old reference to COMPILER_DESIGN:
Estimated hours taken: 0.1

compiler/notes/coding_standards.html:
	Fix an old reference to COMPILER_DESIGN:
	it should be compiler_design.html.
2000-11-28 05:08:47 +00:00
David Overton
45993736a1 Remove SICStus Prolog compatibility requirements from the
Estimated hours taken: 0.1

compiler/notes/coding_standards.html:
        Remove SICStus Prolog compatibility requirements from the
	coding standard.
2000-01-10 06:44:14 +00:00
Bert Thompson
dea497b338 Translated plain text docs to HTML. This obviously creates
Estimated hours taken: 4

Translated plain text docs to HTML. This obviously creates
a dual update problem. We should solve this by putting
the plain text docs in the attic and retaining the HTML.

Also added the HTML files to the Mmakefile so they are installed
on the web pages.

The other documents in compiler/notes will be HTMLized soon.

compiler/notes/
	Mmakefiles
	ALLOCATION.html
	AUTHORS.html
	CODING_STANDARDS.html
	COMPILER_DESIGN.html
	GC_AND_C_CODE.html
	GLOSSARY.html
	MODULE_SYSTEM.html
	RELEASE_CHECKLIST.html
	REVIEWS.html
	TODO.html
1997-04-03 05:17:54 +00:00